Repository navigation
feat(agent-audit): flag stdio MCP servers that run inline/obfuscated code - #75
Merged
Merged
Conversation
…code
`auditMcpServers` only inspected `url`-based MCP servers (flagging http://).
But a *stdio* MCP server runs a local `command` (+args) on every agent startup
— an unwatched code-execution surface. A malicious `.mcp.json` / `.claude.json`
can ship `{"command":"node","args":["-e","…"]}` or `sh -c "curl … | sh"` and it
executes silently whenever the agent launches.
Add `auditMcpStdio`: flags only the unambiguous abuse shapes — a malware-pattern
command line (reusing the hook patterns: pipe-to-shell, /dev/tcp, base64|sh,
eval-substitution) or an interpreter running INLINE code (`node -e`, `python -c`,
`sh -c`, …). It deliberately does NOT flag the common, legitimate `npx <pkg>`
stdio server: blanket-warning every config is the noise that gets security
tooling ignored. Wired into `runAgentAudit` across all known config files.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
|
✅ Docker image built successfully
|
This was referenced Jun 23, 2026
Broadens kit's agent coverage beyond Claude/Cursor/VSCode: - agent-audit: scan `opencode.json`/`opencode.jsonc` and `.codex/config.*` for plaintext secrets (format-agnostic via findSecrets), and recognize OpenCode's `mcp` server container in the cleartext-http and inline-code stdio checks (alongside `mcpServers`/`servers`). - scan-transcripts: walk `.codex/` (project) + `~/.codex/projects/<slug>` for replayed-secret leaks, alongside the existing `.claude`/`.opencode`/`.cursor`/ `.aider` dirs. This also covers agents driven through the t3code GUI harness, since t3code runs the underlying Codex/Claude/Cursor/OpenCode whose dirs these are. (Follow-up: OpenCode's array-form `command` is not yet stdio-audited — missed detection, not a false positive.) Stacked on the stdio-MCP-audit branch. Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg Co-authored-by: Claude <noreply@anthropic.com>
|
✅ Docker image built successfully
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
auditMcpServersonly inspectedurl-based MCP servers (http://). But a stdio MCP server runs a localcommand(+args) on every agent startup — an unwatched code-execution surface. A malicious config can ship{"command":"node","args":["-e","…"]}orsh -c "curl … | sh".Fix:
auditMcpStdioflags only unambiguous abuse shapes — a malware-pattern command line (reusing the hook patterns) or an interpreter running INLINE code (node -e,python -c,sh -c, …). Deliberately does NOT flag the common, legitimatenpx <pkg>server (noise control). Tests added. (Security review finding; relates to #47.)