You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During PR #641 Round-2 blind review (R2-S-2 finding), security-engineer-r2 flagged that bootstrap_gate.py allows MCP tools by default via an implicit prefix-match:
This is correct under current threat models (MCP tools are external integrations the user explicitly granted), but the policy is implicit — there's no allowlist, no logging, and no way for a security review to assert "exactly these MCP tools bypass the bootstrap gate".
Threat scenarios
Untrusted MCP server registration — a user registers an MCP server, perhaps unintentionally trusting an untrusted source. That server's tools all bypass bootstrap-gate enforcement. The user never sees a security boundary for MCP-vs-non-MCP.
MCP tool name collision — a malicious tool registers as mcp__bootstrap_unblock (or similar). Prefix-match exempts it without further inspection.
Audit gap — security-engineer cannot enumerate "which tools bypass bootstrap-gate" by reading bootstrap_gate.py source. The set is whatever's currently registered in MCP — runtime-determined.
Default config: enforcement: "allow" with empty servers list (current behavior preserved). Users can opt into stricter modes.
Option B — log-only (audit-first)
# pact-plugin/hooks/bootstrap_gate.pyiftool_name.startswith("mcp__"):
# Allow for now; log the bypass to journal so audits enumerate_journal_mcp_bypass(tool_name)
returnNone
Journal entry creates an enumerable record without changing default behavior. Cheaper to implement, less invasive.
Recommendation
Start with Option B (audit-first). Adding logging gives security review the enumerable record that's currently missing. If concrete attack scenarios materialize, extend to Option A.
Acceptance criteria
MCP-bypass events emit a mcp_bypass journal event with tool_name, timestamp, session_id.
session_journal.py accepts the new event type.
Test asserts a journal entry is written when mcp__* tool bypasses bootstrap-gate.
Documentation in bootstrap_gate.py docstring explicitly notes "MCP tools bypass; bypasses are logged to journal for audit".
Background
During PR #641 Round-2 blind review (R2-S-2 finding), security-engineer-r2 flagged that
bootstrap_gate.pyallows MCP tools by default via an implicit prefix-match:This is correct under current threat models (MCP tools are external integrations the user explicitly granted), but the policy is implicit — there's no allowlist, no logging, and no way for a security review to assert "exactly these MCP tools bypass the bootstrap gate".
Threat scenarios
mcp__bootstrap_unblock(or similar). Prefix-match exempts it without further inspection.Proposal
Option A — explicit allowlist with config
Default config:
enforcement: "allow"with empty servers list (current behavior preserved). Users can opt into stricter modes.Option B — log-only (audit-first)
Journal entry creates an enumerable record without changing default behavior. Cheaper to implement, less invasive.
Recommendation
Start with Option B (audit-first). Adding logging gives security review the enumerable record that's currently missing. If concrete attack scenarios materialize, extend to Option A.
Acceptance criteria
mcp_bypassjournal event withtool_name,timestamp,session_id.session_journal.pyaccepts the new event type.mcp__*tool bypasses bootstrap-gate.bootstrap_gate.pydocstring explicitly notes "MCP tools bypass; bypasses are logged to journal for audit".Cross-references
bootstrap_gate.pyL170 — current implicit allow