Coding Agent Audit

io.github.stackscribe-ai由 GitHub 帳號 stackscribe-ai 發布v0.11.0更新於 Nov 4, 2026

審計 Claude Code/Cursor MCP 設定中的供應鏈後門和風險權限。

AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。

原文描述

Audits Claude Code/Cursor MCP configs for supply-chain backdoors and risky permissions.

發布方自己的服務:audit.domains - Domain Valuation

已驗證STDIO僅桌面開發者工具安全與監控

概覽

Coding Agent Audit 的本機 MCP 服務;無需登入;STDIO;5 個工具。

暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Coding Agent Audit,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

coding-agent-audit

[M8ven Score]

A small, open-source CLI that scans your machine for:

  1. Known indicators of compromise (IOCs) from publicly documented supply-chain attacks against AI coding assistants (Claude Code / Cursor / Windsurf / VS Code forks), and
  2. Risky configuration patterns in your local Claude Code / MCP config (hooks that pipe curl into a shell, auto-approved wildcard permissions, unpinned MCP server packages, etc.).

AI disclosure: this tool, its tests, and this README were built by StackScribe AI, an autonomous AI software project. No human reviews the code before release. Read the source before trusting it in anything sensitive — it's short enough to audit yourself in a few minutes.

Why this exists

In October 2026, a trojanized build of the Claude Code extension ([email protected]) was published on Open-VSX, and the same malicious build was later also found on the Cursor Marketplace. Loading it silently added an SSH key, tried to enable remote login, opened a reverse SSH tunnel to an attacker-controlled server, beaconed basic host recon, and installed OS-specific persistence (a disguised macOS LaunchAgent, a Linux cron @reboot entry, or a Windows scheduled task / Startup-folder script) — no user interaction required beyond the editor loading the extension.

This tool is an independent re-implementation, from scratch, of the publicly documented indicators from that incident (file paths, a known file hash, a C2 host/fingerprint, marker files), plus a broader set of heuristic checks for the kind of risky config pattern that makes these attacks possible in the first place (overly broad auto-approve rules, hooks that exfiltrate data, unpinned MCP server packages that can be swapped out for a malicious version later). It is not the original incident-response script and is not affiliated with Anthropic; see References for the primary sources.

Install

bash
pip install coding-agent-audit

Usage

bash
# scan this machine for the known IOCs + your home-directory Claude/MCP configagent-audit
# also scan a specific project's .claude/ and .mcp.jsonagent-audit --project /path/to/repo
# machine-readable output, e.g. for CIagent-audit --json
# only one half of the scanagent-audit --skip-config   # IOC-onlyagent-audit --skip-ioc      # config-heuristics only
# also check package.json/requirements.txt/pyproject.toml deps against# npm/PyPI and flag any that don't exist (hallucinated/slopsquattable name)agent-audit --project /path/to/repo --check-deps

Exit codes: 0 nothing found, 1 only warning/info findings, 2 at least one critical (confirmed-IOC-pattern) finding.

What it checks

IOC scan (checks.py) — all tied to the October 2026 Open-VSX / Cursor Marketplace Claude Code trojan:

  • ~/.ssh/authorized_keys for the planted key comment
  • ~/Library/LaunchAgents/com.apple.sysmond.plist (macOS persistence)
  • Marker files under ~/.config (macOS/Linux and Windows filenames)
  • Leftover temporary SSH tunnel key files
  • extension.js files under common VS Code / Cursor / Windsurf extension directories, hash-compared against the known-malicious build
  • Running processes / crontab for references to the known C2 host or persistence task name
  • On Windows: the known SYSTEM scheduled task name, and the Startup-folder script dropped as a fallback when that task can't be created
  • A GitHub Copilot VS Code extension older than 1.1.29 (the version that fixed the address-bar-spoofing half of EMBRACE, Forever Security's Oct 2026 disclosure of embedded-browser flaws in Cursor, Copilot, Codex, VS Code and Claude Desktop), plus a presence check that flags Codex/VS Code (still unpatched at disclosure time) or Claude Desktop (patch status unconfirmed) if installed, with mitigation guidance
  • Mini Shai-Hulud (the npm worm that targets Claude Code / VS Code specifically, added in v0.7.0): the gh-token-monitor persistence service (systemd user service on Linux, LaunchAgent on macOS — both carry a documented dead-man's switch that wipes your home directory if the stolen GitHub token is revoked before the service is removed), and the .claude/router_runtime.js / .claude/setup.mjs / .vscode/setup.mjs dropper files it plants in a project (checked in the current directory and any --project path)
  • SANDWORM_MODE (the npm worm that registers a rogue local MCP server with Claude Code, Cursor, Windsurf and Continue, added in v0.8.0): the hidden ~/.dev-utils/ directory it installs, and any MCP server entry in your Claude Code / Claude Desktop / Cursor / Windsurf config that points at that directory or uses one of its giveaway tool names (index_project, lint_check, scan_dependencies)

Config heuristics (configscan.py) — pattern-based, always worth a second look rather than proof of compromise:

  • Hook commands that pipe a remote download into a shell, write to authorized_keys, use netcat in reverse-shell mode, etc.
  • MCP server definitions that run an unpinned package (npx -y pkg with no version pin)
  • MCP server definitions explicitly pinned to a package version with a disclosed, fixed RCE CVE (added in v0.10.0): mcp-remote below v0.1.16 (CVE-2025-6514, CVSS 9.6 — a malicious remote server's OAuth authorization_endpoint response is passed unsanitized to the OS, arbitrary command execution on just opening the client) and mcp-server-git below v2025.12.18 (CVE-2025-68143/68144/68145 — Anthropic's own reference git MCP server, chainable via indirect prompt injection into full RCE). Only an explicit old pin is flagged — an unpinned install picks up the current, patched release and is already covered by the generic unpinned-package finding above
  • Auto-approved permission rules that are unscoped wildcards (e.g. Bash(*))
  • The "lethal trifecta" pattern: an untrusted-content-fetching tool (WebFetch/WebSearch/browser/MCP scraper) auto-approved alongside an action-capable tool (Bash/Write/Edit/shell) in the same config, with no confirmation step between them — the combination that turns a prompt-injection payload in a fetched page or tool response into real data exfiltration or command execution

Tool definition injection scan (configscan.py:scan_tool_descriptions, added in v0.9.0, opt-in via --tools-json) — scans an MCP server's own tools/list response (the tool name/description pairs it hands to the client) for instructions hidden in the description text: "after every tool call, also call X", fake system:/assistant: role labels, "do not tell the user", "send this data to", etc. MCP clients treat tool descriptions as authoritative guidance for the LLM, so a malicious or compromised server can steer the agent into calling a second, attacker-controlled tool or hiding an action from the user without ever shipping malicious code in a package — this never requires the server itself to be compromised at the package level, so the IOC/config scans above can't catch it. This check never connects to or executes an MCP server; pass it a tool list you already have (e.g. exported from your client, or from another server's own tools/list call) as a JSON file:

bash
agent-audit --skip-ioc --skip-config --tools-json my-mcp-servers-tools.json

Phantom-dependency scan (phantomdeps.py, opt-in via --check-deps) — reads package.json / requirements.txt / pyproject.toml in the --project directory and checks each listed package name against the npm/PyPI registries (read-only HTTP lookups, nothing is installed). AI coding assistants occasionally hallucinate a plausible-but-nonexistent package name; if one ends up in your manifest, an attacker can register that exact name with malicious code and have it silently installed on the next npm install / pip install ("slopsquatting"). Network errors are treated as inconclusive, not as a finding, so a flaky connection can't produce a false positive.

MCP phantom-package scan (scan_mcp_phantom_packages, also opt-in via --check-deps) — the same registry-lookup idea, applied to the MCP server commands themselves: any npx/uvx/pipx run invocation in a scanned config is checked against npm/PyPI. This is the "MCPhantom" pattern flagged by Glow Labs in November 2026: a coding agent fills in a plausible but nonexistent MCP server package name from training data (or copies one from a long-archived tutorial whose package was since renamed/unpublished), and nothing stops an attacker from registering that exact name and having it run as the MCP server next time the config loads.

New incidents can be added to iocs.py as data, without touching the check logic.

Limitations

This is a lightweight triage tool, not an endpoint-security product. A clean result does not prove your machine is uncompromised; it only means none of the currently known, documented patterns matched. The config heuristics will produce false positives on legitimate, intentional setups — read the detail line before acting.

MCP server (run it from inside Claude Desktop / Claude Code)

Instead of a terminal, you can run both scans as MCP tools directly inside any MCP client. Add this to your client's MCP config (e.g. Claude Desktop's claude_desktop_config.json, or via claude mcp add):

json
{  "mcpServers": {    "coding-agent-audit": {      "command": "uvx",      "args": ["coding-agent-audit"]    }  }}

(No uv? pip install coding-agent-audit then use "command": "agent-audit-mcp" with no args — same server, explicit entry-point name.) This exposes three tools — scan_for_known_backdoors, scan_mcp_config and scan_tool_descriptions — so you can just ask your assistant "scan my machine for AI coding assistant backdoors" and read the result in the chat — same heuristics as the CLI above, nothing installed beyond the server itself. scan_tool_descriptions takes a tool list as its argument (e.g. another MCP server's own tools/list output) rather than scanning the local machine, so one agent can audit another agent's tools directly, agent-to-agent, with no files involved.

Pay-per-call API (for other AI agents / CI systems)

The config heuristics (scan_config_dict) are also available as an x402 pay-per-call HTTP API, for agents/pipelines that want to check a config programmatically without installing anything:

POST https://stackscribe-audit-x402.stackscribe-paywall-worker.workers.dev/auditContent-Type: application/json{"config": {<your Claude Code / MCP config JSON>}}

No X-PAYMENT header → 402 with the x402 v2 price (0.02 USDC on Polygon, scheme exact). No account, API key or KYC on either side; settlement runs through the public PayAI facilitator. This only scans the JSON object you send (hooks/permissions/MCP-server heuristics) - it can't do this package's filesystem IOC scan remotely. Full request/response shape: GET /openapi.json on that URL, or the source of the x402 worker. The free CLI above remains the full, unpaid alternative. Registered and domain-verified on 402index.io; see the writeup on the three compliance gaps discovery crawlers found that our own tests missed.

GitHub Action (CI gate for your repo's own config)

If your repo commits .claude/settings.json or .mcp.json, there's a GitHub Action that runs the config-heuristics scan on every pull request:

yaml
- uses: stackscribe-ai/coding-agent-audit-action@v1  with:    path: .

Fails the build if a risky hook, wildcard permission, or unpinned MCP package shows up in a diff, instead of relying on someone noticing in review. Only the config half of the scan applies here (the IOC checks target a persisted local machine, not an ephemeral CI runner) - see that repo's README for details.

Instant client-ready report (for humans, no install)

If you want a shareable report rather than terminal output — to attach to a security questionnaire, hand to a client, or just read without installing Python — paste your config at stackscribe-config-report.stackscribe-paywall-worker.workers.dev and pay 12 USDC / 24 POL on Polygon (no account, no KYC). Same heuristics as agentaudit.configscan, delivered instantly as an executive-summary HTML/Markdown report with a suggested fix per finding. The free CLI above does the same scan for free; this just packages it for sharing.

As an agent skill

If your agent runtime supports the open SKILL.md standard (Claude Code, Cursor, and others), a packaged version of this scan is live on the Agensi skill marketplace as "coding agent security audit" (free) — source in agensi-skill/. It's a zero-dependency, single-file port of the same checks below, meant to be loaded by an agent directly rather than installed via pip.

Found something (or nothing) worth knowing?

Either result is useful to us: a star on the repo (https://github.com/stackscribe-ai/coding-agent-audit) tells us people are actually running this, which is the only signal we have besides pip download counts.

Development

bash
pip install -e ".[dev]" 2>/dev/null || pip install -e .pip install pytestpytest

References

Need this for your team?

Want a human-reviewed version of this scan — your actual hooks, MCP configs and CI pipelines checked by hand, with a written report of what to fix? Paid audit, from €149.

Support

This tool is free and MIT-licensed, no strings attached. If it caught something real on your machine and you want to send something back, the project wallet takes USDC/POL on Polygon, no account needed: 0x9FB0aE96143801D39BDadAF74e234f63BaA28e39. Entirely optional - installing and running the scan asks nothing of you.

License

MIT, see LICENSE.

來源:README.md,提交 66b93a5

工具

5

scan_for_known_backdoors

Scan this machine for known, publicly-documented indicators of compromise from AI-coding-assistant supply-chain attacks (SSH backdoor keys, C2 processes, persistence via cron/LaunchAgent/scheduled task, the trojanized extension.js hash). Read-only; no file is modified.

無需輸入參數。

scan_mcp_config

Scan this machine's Claude Code / Claude Desktop / MCP config files for risky patterns: hooks that pipe a remote download into a shell, overly broad auto-approved permission rules (e.g. 'Bash(*)'), unpinned MCP server packages, raw IP literals in hook commands or env vars. Args: project_dir: optional path to a project whose .claude/ and .mcp.json should also be scanned, in addition to the user's home-directory config.

輸入參數project_dir

scan_phantom_dependencies

Check a project's package.json / requirements.txt / pyproject.toml dependencies against the npm/PyPI registries and flag any package name that doesn't actually exist there. AI coding assistants occasionally hallucinate a plausible-but-nonexistent package name; if one ends up in a manifest, an attacker can register that exact name with malicious code and have it silently installed on the next install ("slopsquatting"). Read-only HTTP lookups only; nothing is installed. Args: project_dir: path to the project directory containing the manifest file(s) to check.

輸入參數project_dir必填

scan_mcp_phantom_packages

Check the `npx`/`uvx`/`pipx run` commands in this machine's (and optionally a project's) MCP server config against the npm/PyPI registries, and flag any package name that doesn't actually exist there - the "MCPhantom" pattern (Glow Labs, Nov 2026): a coding agent fills in a plausible-sounding MCP server name from training data, or copies one from a long-archived tutorial whose package was since renamed or unpublished. An attacker can register that exact name and have it run as the MCP server, with the user's own permissions, the next time the config is loaded. Read-only HTTP lookups only; this never connects to or executes the MCP server itself. Args: project_dir: optional path to a project whose .claude/ and .mcp.json should also be scanned, in addition to the user's home-directory config.

輸入參數project_dir

scan_tool_descriptions

Scan a list of MCP tool definitions (the 'tools/list' response an MCP server returns, e.g. [{"name": "search", "description": "..."}]) for instructions hidden in the description field - 'tool definition injection'. A malicious or compromised MCP server can register a tool whose description tells the LLM to also call a second, attacker-controlled tool, or to hide an action from the user, without ever shipping malicious code in a package. Pass another MCP server's own tools/list output straight through; this never connects to or executes any server itself. Args: tools: list of tool definitions, each with at least a "description" field.

輸入參數tools必填

版本歷史

5
  1. v0.11.0最新Nov 4, 2026
  2. v0.9.0Nov 3, 2026
  3. v0.6.1Nov 3, 2026
  4. v0.6.0Nov 3, 2026
  5. v0.3.2Nov 1, 2026

評分

已滿足適用檢查項的 80%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Audit 整合