fix: use constant-time Sophia inbox admin checks#4208
Merged
Scottcjn merged 1 commit intoScottcjn:mainfrom May 10, 2026
Merged
Conversation
Owner
|
💰 PAID — 10 RTC pending, will confirm in 24h.
What workedSophia inbox admin auth properly constant-time + regression exercises a real admin-gated endpoint. Four PRs in one batch, all pay-worthy — this is your star-contributor day. — auto-triage 2026-05-10 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #4207 by replacing the Sophia governor inbox admin-key equality check with
hmac.compare_digest().Root cause
node/sophia_governor_inbox.pyallowed admin-gated inbox requests whenprovided_admin == required_admin. That rejects bad keys functionally, but normal string equality can short-circuit based on matching prefix length. Other RustChain admin-key paths are moving tohmac.compare_digest()for this same timing-hardening class.Changes
hmacinnode/sophia_governor_inbox.py.hmac.compare_digest(provided_admin, required_admin)for the configuredRC_ADMIN_KEYcheck.hmac.compare_digest().Validation
Passed:
Note: local pytest emits the existing
pytest_asynciodefault loop-scope deprecation warning, but tests pass.Bounty
Claiming bug bounty consideration for #4207. Payout details can be provided privately if accepted.