Skip to content

fix(acp): compare mcp_app_proxy secrets in constant time - #13778

Merged
jbg merged 1 commit into
aaif-goose:mainfrom
freedom2132:fix-constant-time-secret-compare
Dec 1, 2026
Merged

jbg merged 1 commit into
aaif-goose:mainfrom
freedom2132:fix-constant-time-secret-compare

Conversation

@freedom2132

@freedom2132 freedom2132 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #13779.

Problem

The two secret checks in (query param and body) use plain string , while the main routing path already compares ACP tokens in constant time via (, ). String short-circuits on the first differing byte, leaking a (loopback-limited, low-bandwidth) timing side channel on the proxy secret and diverging from the established comparison discipline in the same crate.

Fix

Route both remaining checks through , which returns for length mismatches and otherwise performs a constant-time byte comparison. No behavior change for correct secrets. Loopback guard and the rest of the proxy logic are untouched.

The two secret checks in mcp_app_proxy (query param and body) use plain
string !=, while the main routing path already compares tokens in
constant time via subtle::ConstantTimeEq (acp/transport/auth.rs
token_matches). Route both remaining checks through token_matches for
consistency and to avoid a timing side channel on the proxy secret.
@freedom2132
freedom2132 requested a review from a team as a code owner November 24, 2026 02:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T02:31:09.822544Z f176340 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DOsinga

DOsinga commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

🤖
Thanks for contributing. Goose uses an issue-first workflow. Please open or identify the issue for this work, wait until it reaches Ready, and link it from this pull request with Closes #ISSUE_NUMBER.

See From Issue to Pull Request. If no issue is linked and nobody replies here, this pull request will be closed after three days.

@freedom2132

Copy link
Copy Markdown
Contributor Author

Companion issue opened per the issue-first workflow: #13779 (the PR body references it as Fixes #13779). The linked issue describes the divergent comparison discipline and the timing side channel; this PR is the two-line consistency fix.

@jbg
jbg added this pull request to the merge queue Dec 1, 2026
Merged via the queue into aaif-goose:main with commit f9c5a49 Dec 1, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp_app_proxy compares the shared secret with plain != instead of constant-time comparison

3 participants