Skip to content

fix(mcp): fail closed on Untrusted trust level with no tool_allowlist#6505

Merged
bug-ops merged 1 commit into
mainfrom
fix/6474-mcp-untrusted-allowlist-fail-open
Jul 19, 2026
Merged

fix(mcp): fail closed on Untrusted trust level with no tool_allowlist#6505
bug-ops merged 1 commit into
mainfrom
fix/6474-mcp-untrusted-allowlist-fail-open

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • apply_allowlist() fail-opened the default Untrusted MCP trust level when tool_allowlist was unset, exposing every tool with only a warn! log — including for every IDE-requested server via the ACP bridge, which hardcodes exactly this configuration.
  • Untrusted + no allowlist now fails closed (zero tools) by default, matching Sandboxed. A new per-server opt-in flag allow_untrusted_without_allowlist (default false) restores the previous expose-all behavior for operators who want it explicitly.
  • The unmatched-trust-level catch-all now also fails closed instead of exposing all tools, closing a latent gap for future #[non_exhaustive] McpTrustLevel variants.
  • expected_tools attestation no longer acts as an implicit allowlist substitute — this is a documented behavior change (see CHANGELOG).
  • Removes a stale doc comment, TODO, and dead #[allow(...)] block orphaned above IngestConfig after ingest_tools moved to its own module.

Closes #6474
Closes #6477

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 — 14612 passed, 35 skipped, 0 failed
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"
  • New regression tests cover: Untrusted+None fails closed by default, opt-in flag exposes all, Sandboxed unaffected, Trusted unaffected, expected_tools does not substitute for an allowlist, unrecognized trust level fails closed
  • gitleaks protect --staged clean

@github-actions github-actions Bot added bug Something isn't working size/L Large PR (201-500 lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate config Configuration file changes labels Jul 19, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 19, 2026 18:41
apply_allowlist() exposed all tools for the default Untrusted trust
level when tool_allowlist was unset, logging only a warning. Sandboxed
already failed closed in the same situation, and the ACP bridge
hardcodes Untrusted+None for every IDE-requested server, defeating its
own sandboxing claim.

Untrusted+None now returns zero tools by default, matching Sandboxed.
A new per-server allow_untrusted_without_allowlist flag (default
false) preserves the previous expose-all behavior for operators who
opt in explicitly. The unmatched-trust-level catch-all also now fails
closed instead of exposing all tools, closing a latent gap where a
future non_exhaustive McpTrustLevel variant would silently expose
everything.

expected_tools attestation no longer substitutes as an implicit
allowlist: an Untrusted server with expected_tools set but no
tool_allowlist and the opt-in flag unset now exposes zero tools.

Also removes a stale doc comment, TODO, and dead clippy allow left
above IngestConfig after ingest_tools moved to its own module.

Closes #6474
Closes #6477
@bug-ops
bug-ops force-pushed the fix/6474-mcp-untrusted-allowlist-fail-open branch from 8f1607a to 498e8c4 Compare July 19, 2026 18:41
@bug-ops
bug-ops merged commit 7aa6fd5 into main Jul 19, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6474-mcp-untrusted-allowlist-fail-open branch July 19, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working config Configuration file changes core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

1 participant