fix: require admin key on POST /beacon/submit (RIP-BUG-001)#6639
fix: require admin key on POST /beacon/submit (RIP-BUG-001)#6639BossChaos wants to merge 1 commit into
Conversation
… envelope injection (RIP-BUG-001)
aisoh877
left a comment
There was a problem hiding this comment.
Thanks for taking on the beacon hardening work. I think the /beacon/submit auth change needs to be reworked before this can merge.
/beacon/submit is the public SDK/API path for submitting signed beacon envelopes (sdk/python/rustchain_sdk/client.py posts to this endpoint without an admin header), and the endpoint already validates the envelope fields and signature before storing. This PR now rejects every normal signed beacon submission unless the caller also has RC_ADMIN_KEY, so existing SDK clients and public agent submissions get 401 admin_required before signature validation. That turns the Beacon submit API into an admin-only ingestion path rather than a signed public submission path.
If the goal is to prevent forged envelope injection, the safer fix is to keep this route public but rely on the existing signature/pubkey/agent-id validation and add route-level regression tests proving unsigned or tampered envelopes are rejected. If an admin-only ingestion path is needed, it should be a separate endpoint or the SDK/docs/tests need to be updated together.
I also could not run the focused pytest suite in this checkout because the remote Python environment is missing flask/pytest, but the changed route and SDK call site show the compatibility break statically.
|
@BossChaos — closing per Codex authoritative audit. This PR falls back into the old problem shape. Title claims single-route fix ( This is the same pattern that got #6559 closed. After the lesson on #6559 → #6638 (where the disclosure recovery loop genuinely worked), this PR went back to bundling. Required change: strict per-route scope. ONE route per PR. ONE title-claim per PR. ONE test suite per PR (or coverage extension of an existing one). If you want to ship 3 fixes, file 3 PRs. No penalty here — but two REJECTs same day from the same author signals you're not internalizing the scope discipline. The pre-merge Codex gate stays on your Critical/High submissions. Path forward: pick the single highest-value finding from this bundle, file it as a clean per-route PR. Repeat for each other finding. Each clean per-route PR is its own bounty. |
|
Closed REJECT — bundled multiple security changes inside single-route-claim title. Same scope-explosion shape as #6559. Split into per-route PRs. |
Summary
Adds
X-Admin-Keyauthentication requirement to thePOST /beacon/submitendpoint to prevent unauthorized beacon envelope injection.Vulnerability
/beacon/submitendpoint accepts and stores beacon envelopes without verifying admin credentials. An attacker can fill thebeacon_envelopestable with garbage data, causing DoS and corrupting beacon randomness.Fix
Added
is_admin(request)check at the top ofbeacon_submit(), returning401if theX-Admin-Keyheader does not match the configuredRC_ADMIN_KEY.Testing