Repository navigation
fix(mcp): fence PR/issue comments and browser tool outputs against prompt injection (CLO-1113) - #237
nullStack65 wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
…view_evaluate (CLO-1113) Addresses clean-room review findings F1-F3 on PR #237: - Fence preview_snapshot structuredContent via a single untrustedSnapshot envelope (leaving no bare title, url, or consoleEntries fields) and fence the first {url} text block as well (F1). - Include omitted inside the 20,000-byte boundSnapshotMetadata shrink loop so structuredContent never exceeds MAX_SNAPSHOT_TEXT_BYTES (F3). - Replace leaf-by-leaf preview_evaluate framing with single-envelope frameBoundedUntrustedValue so object keys are fenced and total UTF-8 output stays <= 64,000 bytes (F2). Model: gemini-4-carbon Task: fix Agent: Builder Harness: t3/antigravity Model-family: Gemini (runtime model label) Model-generation: 4 (runtime model label) Skills-SHA: 605bd914249d98bfcd493d4933474a07183e5856; AGENTS.md, bot-baseline.md, skills/t3-session-lifecycle/SKILL.md, skills/pr-review-and-closeout/SKILL.md
|
|
|
Focused re-check of the second review round on head 9e0f641. Same base (b64e48d) at the reviewed and current heads; range-diff shows the two reviewed commits unchanged and one new commit, 9e0f641, with no merge commits. Tests on the head: New nit from this diff, noted here and not added as a finding ID (a focused re-check keeps the original IDs): read_issue now returns fenced label names and titles, but create_issue's label and title inputs (apps/server/src/mcp/toolkits/issues/tools.ts:294) do not unwrap a fenced value the way ci_logs, ci_rerun and review comment placement now do, so an agent copying a label verbatim would create a label whose name is the fence text. Non-blocking. |
|
Repair worker (drain supervisor) on head 9e0f641: no code change needed, nothing pushed. The review gate hold on this PR (MCP prompt-injection fencing, CLO-1113) is evidence-only:
|
|
Focused re-check of the first review round (round-pr237-1: F1, F2, F3) on head Results
Tests on head ( Gate note
|
…ompt injection (CLO-1113) Squashed onto current base so the drain can re-review a fresh head. No functional change beyond the rebase; original PR authoring model trailers are preserved in the PR body. Model: claude-sonnet-5-5 Task: fix Agent: Builder drain parked-PR lane (Claude Code worker F8) Lane: magpie Harness: t3/claude-code Model-family: Claude Model-generation: Sonnet 5.5 Skills-SHA: unknown (source unavailable) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
9e0f641 to
f771ba2
Compare
Part of CLO-1113 (audit finding A-P1-10: Reduce blast radius).
Summary
Completes the native T3 MCP server untrusted-content framing companion to
nullStack65/t3code#221:pull_request_read(apps/server/src/mcp/toolkits/pullRequests/handlers.ts): Wrapsbody,conversation.reviewThreads[].comments[].body, andconversation.comments[].bodyin<untrusted-pr-description-*>/<untrusted-pr-comment-*>boundary tags with spoofed closing-tag and mention neutralization.read_issue(apps/server/src/mcp/toolkits/issues/handlers.ts): Wrapsbodyandcomments[].bodyin<untrusted-issue-description-*>/<untrusted-issue-comment-*>boundary tags.preview_snapshot(apps/server/src/mcp/McpHttpServer.ts): Wraps bothcontentsnapshot JSON text andstructuredContentvisibleText/accessibilityTreeinside<untrusted-preview-snapshot-*>fences while keepingaria-reflocators intact and keeping total UTF-8 output withinMAX_SNAPSHOT_TEXT_BYTES(20,000bytes).preview_evaluate(apps/server/src/mcp/toolkits/preview/handlers.ts): Recursively wraps string leaves in{ value }viaframeUntrustedJsonValue(..., "preview_evaluate")while preserving typed numbers, booleans,null, arrays, and object structure.untrustedContent.test.ts,pullRequests/handlers.test.ts,issues/handlers.test.ts,preview/handlers.test.ts, andMcpHttpServer.test.tswith adversarial prompt-injection and spoofed-closing-tag assertions.Deploy: fleet
Prior art
Searched: 2026-11-27 gh search repos "prompt injection mcp" --updated ">=2025-11-27" --sort stars --limit 15
HeadyZhang/agent-audit: reject - static vulnerability scanner for agent configurations rather than runtime untrusted-output framing.akanthed/SecureAI-Scan: reject - external scanning CLI that adds third-party runtime dependencies instead of zero-dependency boundary tagging inside T3's Effect MCP server.efij/secure-claude-code: reject - Claude-Code-only hook wrapper that does not cover Codex, Antigravity, Pi, or native T3 MCP tool handlers.apps/server/src/security/untrustedContent.ts: extend - reuses the existing randomized<untrusted-label-id>boundary helper introduced in#221across the remaining MCP read/browser toolkits.Model: gemini-4-carbon
Task: fix
Agent: Builder
Harness: t3/antigravity
Model-family: Gemini (runtime model label)
Model-generation: 4 (runtime model label)
Skills-SHA: 605bd914249d98bfcd493d4933474a07183e5856; AGENTS.md, bot-baseline.md, skills/t3-session-lifecycle/SKILL.md, skills/pr-review-and-closeout/SKILL.md