Skip to content

fix(mcp): lock tool_list for OAuth-transport MCP connections - #6138

Merged
bug-ops merged 1 commit into
mainfrom
fix/6118-mcp-oauth-tool-list-lock
Jul 12, 2026
Merged

fix(mcp): lock tool_list for OAuth-transport MCP connections#6138
bug-ops merged 1 commit into
mainfrom
fix/6118-mcp-oauth-tool-list-lock

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • spawn_oauth_connections never inserted the connecting server's ID into tool_list_locked, so the lock_tool_list hardening option silently exempted OAuth-transport MCP servers from post-attestation tool-injection protection, while stdio/HTTP/SSE servers were correctly covered.
  • The lock is now inserted before the OAuth handshake starts, mirroring the non-OAuth path, and removed on handshake failure in process_oauth_results so a failed connection isn't left permanently locked.
  • Added the first-ever test coverage for the lock_tool_list/tool_list_locked invariant (4 new tests).

Closes #6118

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins (13079 passed, 0 failed)
  • Rustdoc gate (RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace ...)
  • cargo test -p zeph-mcp --lib manager::tests re-verified after rebase onto latest main (95 passed, 0 failed)
  • Adversarial critique (rust-critic): verdict approved, 2 minor pre-existing non-blocking findings noted (unrelated cleanup asymmetry in remove_server/shutdown_all_shared/handle_connect_result probe-block — candidate for a separate P3 follow-up, not part of this fix)
  • Code review: approved, no changes requested
  • .local/testing/playbooks/mcp.md and .local/testing/coverage-status.md updated in the main repo per project convention

@github-actions github-actions Bot added bug Something isn't working size/M Medium PR (51-200 lines) documentation Improvements or additions to documentation rust Rust code changes labels Jul 12, 2026
@bug-ops
bug-ops force-pushed the fix/6118-mcp-oauth-tool-list-lock branch from 210d77f to 24cc006 Compare July 12, 2026 14:56
@bug-ops
bug-ops enabled auto-merge (squash) July 12, 2026 14:56
spawn_oauth_connections never inserted the connecting server's ID into
tool_list_locked, so the lock_tool_list hardening option silently
exempted OAuth-transport servers from post-attestation tool-injection
protection while stdio/HTTP/SSE servers were correctly covered.

Insert the lock before the OAuth handshake starts, mirroring the
non-OAuth path, and remove it on handshake failure in
process_oauth_results so a failed connection is not left permanently
locked. Adds first-ever test coverage for the lock_tool_list/
tool_list_locked invariant.

Closes #6118
@bug-ops
bug-ops force-pushed the fix/6118-mcp-oauth-tool-list-lock branch from 24cc006 to b4694b3 Compare July 12, 2026 15:05
@bug-ops
bug-ops merged commit 90419ae into main Jul 12, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6118-mcp-oauth-tool-list-lock branch July 12, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lock_tool_list hardening option silently exempts OAuth-transport MCP servers from tool-smuggling protection

1 participant