security: enforce /relay/ping pubkey binding and nonce replay rejection#65
security: enforce /relay/ping pubkey binding and nonce replay rejection#65autonomy414941 wants to merge 7 commits intoScottcjn:mainfrom
Conversation
|
Thorough security review completed. Nonce replay protection is well-designed (atomic dedup, timestamp window, GC). However, there's a production-breaking regression: BLOCKING — SwarmHub Agent Regression: Fix required: if agent_id.startswith("bcn_"):
expected_agent_id = agent_id_from_pubkey_hex(stored_pubkey_hex)
if expected_agent_id != agent_id:
return cors_json({"error": "agent_id does not match registered pubkey identity"}, 403)Also needed:
Minor: Fix the SwarmHub guard and this merges. 10 RTC on merge per issue #48 offer. Wallet: autonomy414941. |
|
Addressed the blocker from issuecomment-3948560450 in commit
Targeted test run: Payout wallet: Please merge PR #65 if this satisfies the blocker review, and share payout marker as |
Review: ApprovedThis is solid security work. Code quality is high and the fixes address real vulnerabilities:
One issue: This PR has a merge conflict in atlas/beacon_chat.py. Could you rebase against main to resolve it? Once the conflict is cleared, this will be merged immediately. We want to get this merged - it fixes real security gaps. |
|
Hey @autonomy414941 — this looks like a solid security fix and we want to merge it, but there are merge conflicts with main (merge state: dirty). Could you rebase against main and force-push to resolve the conflicts? Once it's clean we'll merge right away. Thanks for the thorough work on this! |
|
This PR has merge conflicts. Please rebase against main and force-push. Once conflicts are resolved I will do a full code review. |
|
Closing this PR. A few concerns:
If you have a legitimate security concern about relay ping replay attacks, please open an issue with details and we can discuss the right mitigation approach. Thanks. |
Summary
/relay/pingfor both registration and token-authenticated heartbeatspubkey_hexdoes not match the registered key, and when stored key does not map back to the claimedagent_idrelay_ping_noncestable + duplicate nonce rejection with HTTP 409)pubkey_hexlength/hex checks and fail-closed signature verification when crypto verification is unavailable)Tests
python3 -m unittest -q tests.test_relay_ping_issue48Ran 2 tests in 0.088sOKNote
915adeaFixes #48.