This repository was archived by the owner on Jul 10, 2026. It is now read-only.
fix(axon): reject requests with missing signature in default_verify#3393
Merged
basfroman merged 5 commits intoJun 22, 2026
Merged
Conversation
58e5f28 to
c2fec1f
Compare
default_verify gated the signature check behind `if synapse.dendrite.signature`, so a request with an empty or absent signature skipped verification entirely. This lets anyone impersonate any dendrite hotkey (e.g. a high-stake validator) by simply omitting the signature — the request then passes verify and reaches blacklist/forward as if it were genuinely signed. Require a signature to be present, mirroring the existing "Missing Nonce" guard, then verify it. A present-but-invalid signature was already rejected; this closes the empty-signature hole.
default_verify gated the signature check behind `if synapse.dendrite.signature`, so a request with an empty or absent signature skipped verification entirely. This lets anyone impersonate any dendrite hotkey (e.g. a high-stake validator) by simply omitting the signature — the request then passes verify and reaches blacklist/forward as if it were genuinely signed. Require a signature to be present, mirroring the existing "Missing Nonce" guard, then verify it. A present-but-invalid signature was already rejected; this closes the empty-signature hole.
Exercise Axon.default_verify directly: a valid signature passes (nonce recorded), an empty or absent signature now raises "Missing Signature" (the auth-bypass regression this branch fixes), and a present-but-invalid signature still raises "Signature mismatch". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c2fec1f to
2071469
Compare
basfroman
suggested changes
Jun 18, 2026
basfroman
left a comment
Collaborator
There was a problem hiding this comment.
Nice fix, the change is correct and well-documented.
One suggestion: test_default_verify_empty_signature_raises and test_default_verify_missing_signature_raises test the same code path (if not synapse.dendrite.signature) with different falsy values. Consider merging them into a single parametrized test to avoid near-duplication:
@pytest.mark.parametrize("empty_sig", ["", None])
async def test_default_verify_missing_signature_raises(empty_sig):
...Otherwise LGTM. Please address this and re-request review.
… test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Hi @basfroman, thank you for the review. I have pushed the requested changes. |
basfroman
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Issue: #3392
Summary: Axon.default_verify (bittensor/core/axon.py) skips signature verification entirely when the incoming request carries no signature, allowing any caller to impersonate any dendrite hotkey.
Description of the Change
default_verify reconstructs the signed message from the request headers and then runs three checks in order: it rejects a missing nonce ("Missing Nonce"), rejects a stale nonce, and finally verifies the signature.
The signature check was written as a single combined condition:
Because signature presence is and-ed with the verification, an empty or absent
synapse.dendrite.signatureshort-circuits the expression to False, sokeypair.verify(...)is never called. The request then falls through the rest ofdefault_verifyas authenticated — the nonce is even recorded. There is a "Missing Nonce" guard but no matching "Missing Signature" guard.This change adds the missing presence guard (mirroring the nonce guard) and then verifies unconditionally:
A present-but-invalid signature was already rejected correctly (keypair.verify → False → raise). The only hole was the empty/absent case, which this closes.
Impact: an attacker can claim any hotkey in bt_header_dendrite_hotkey — including a high-stake validator — and send no signature. The forged request passes default_verify and reaches the subnet's blacklist/forward. On the standard miner
blacklist (gated on validator_permit + stake), this lets an attacker harvest miner outputs while masquerading as a legitimate validator, with no secret material required.
Alternate Designs
two-step form is clearer and gives an actionable error.
check is safer and self-documenting.
The proposed version was chosen for explicitness, a clear distinct error message, and symmetry with the surrounding nonce checks.
Possible Drawbacks
Verification Process
Release Notes
Reject requests with missing signature
Branch Acknowledgement