Skip to content

fix: guard handle_pat_check against unregistered hotkey #1313

Closed
Lance-Python-Dev wants to merge 1 commit into
entrius:testfrom
Lance-Python-Dev:fix/patcheck-hotkey-guard
Closed

fix: guard handle_pat_check against unregistered hotkey #1313
Lance-Python-Dev wants to merge 1 commit into
entrius:testfrom
Lance-Python-Dev:fix/patcheck-hotkey-guard

Conversation

@Lance-Python-Dev
Copy link
Copy Markdown

Closes #1297

handle_pat_check called validator.metagraph.hotkeys.index(hotkey)
without first checking that the hotkey is still registered. If a miner
deregisters between the blacklist check and the handler, .index() raises
an uncaught ValueError that crashes the axon handler.

Added the same guard already present in handle_pat_broadcast: return
early with has_pat=False if the hotkey is not found in the metagraph.

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 19, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 19, 2026

Duplicate of #1302 which is better scoped/implemented. Closing.

@anderdc anderdc closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CRITICAL] Validator DoS via unguarded .index() in handle_pat_check — TOCTOU race crashes axon handler

2 participants