fix(proxy): require downstream auth for Codex OAuth - #2
Closed
elkimek wants to merge 1 commit into
Closed
Conversation
Require an owner-only regular token file before loopback clients can spend the profile-owned Codex subscription. Enforce the same boundary in CLI and programmatic server startup, compare bearer credentials in constant time, and prove unauthorized callers never resolve or contact the upstream. Co-authored-by: Dillon Townsel <dillontownsel@gmail.com>
This was referenced Aug 23, 2026
Author
|
Superseded by the direct replacement PR against the canonical upstream repository: NousResearch#92750. That PR preserves Chris Munn’s original authorship and includes this hardening on current upstream main. |
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
Stacked security follow-up for NousResearch/hermes-agent#91199, isolated against its exact head
bb23a98be19ce32d1c6ca3a6abf4306acf7d59db./healthand/v1/*; unauthorized health checks cannot learn or mutate pool availability0600on POSIX)create_app/run_serverpathsThe implementation carries forward the downstream bearer pattern from NousResearch#62510 while retaining NousResearch#91199's stronger credential-pool, exact-upstream, raw-byte, query, retry, and cleanup behavior.
Security invariant
Loopback constrains reachability; it does not prove caller authority on a multi-user host. Missing or incorrect client credentials return
401 proxy_auth_failedbefore Hermes reads credential-pool availability, resolves a bearer, or contacts the upstream.Verification
scripts/run_tests.sh tests/hermes_cli/test_proxy.py tests/hermes_cli/test_proxy_codex.py— 33 passedgit diff --check— passed/healthcalls now return 401 with zerois_authenticated()/get_credential()calls/health— HTTP 401proxy_auth_failed/health— HTTP 200, upstream authenticated/v1/responses— HTTP 200,response.completed, exactCODEX_PROXY_REVIEW_FIX_OKNo credential value, credential file, or production service change is included.