Skip to content

fix(security): extend MCP env var blocklist and fix audit logger silent drop#2446

Merged
bug-ops merged 1 commit intomainfrom
2437-extend-mcp-env-var-blocklist
Mar 30, 2026
Merged

fix(security): extend MCP env var blocklist and fix audit logger silent drop#2446
bug-ops merged 1 commit intomainfrom
2437-extend-mcp-env-var-blocklist

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 30, 2026

Summary

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean
  • cargo nextest run --workspace --features full --lib --bins — 7279 passed
  • New and updated unit tests in mcp_bridge.rs cover all 14 newly-blocked env var names plus case-insensitivity

…nt drop

Closes #2437, closes #2438.

- Extend `is_dangerous_env_var()` in `mcp_bridge.rs` to block PATH (path
  hijacking), HTTP_PROXY/HTTPS_PROXY/ALL_PROXY/NO_PROXY (proxy interception),
  BASH_ENV/ENV (shell startup injection), and PYTHONPATH/NODE_PATH/RUBYLIB
  (runtime module injection). These vars were not filtered by PR #2436.

- Replace silent `return` in `AuditLogger::log()` with
  `tracing::error!("audit entry serialization failed: {err}")` so
  serialization failures are observable in logs instead of silently dropped.

- Update and extend tests for both changes.

Note: #2412 was already resolved in PR #2423 (ProtocolVersion::LATEST in
discovery handler); CHANGELOG entry added only.
@bug-ops bug-ops enabled auto-merge (squash) March 30, 2026 16:47
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 30, 2026
@bug-ops bug-ops merged commit a8f6d01 into main Mar 30, 2026
27 checks passed
@bug-ops bug-ops deleted the 2437-extend-mcp-env-var-blocklist branch March 30, 2026 16:54
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

1 participant