AAK-HOOK-RCE-003: Claude Code below 1.0.111 runs project code before the trust dialog (CVE-2025-59536)
- Severity
- HIGH
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py- Auto-fixable
- No.
- SARIF name
HookTrustBypass
What it detects
Claude Code (@anthropic-ai/claude-code, npm) shows a startup trust dialog before it acts on what a project carries, such as the hooks in its .claude/settings.json. Before 1.0.111, a bug in that dialog meant Claude Code "could be tricked to execute code contained in a project before the user accepted the startup trust dialog", so starting it in a cloned repository was enough (CVE-2025-59536, CVSS 4.0 8.7, CWE-94, GHSA-4fgq-fpq9-mr3g). This pin-only rule fires on a declared @anthropic-ai/claude-code below 1.0.111. Until 2026-10-17 it fired on any command in a settings.local.json instead, which cannot show whether a hook runs before the dialog: the release decides that. Auto-update has delivered the fix to installs that keep it on.
How to fix
Upgrade @anthropic-ai/claude-code to 1.0.111 or later and pin it, or leave auto-update on.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-HOOK-RCE-003
Limitations
Reports @anthropic-ai/claude-code below 1.0.111 where a project states its version: a package.json or lockfile entry at the root, or a versioned npx reference in an MCP config. An unpinned reference is not reported, as for the other Claude Code pins: it resolves to the newest release, and the CLI updates itself. A global install, the usual one, is in no file AAK reads, and neither is a package.json in a sub-directory. A file over 2 MB, or a lockfile over 32 MiB, is not read. Settings files and hook commands are not read: whether a hook runs before the trust dialog depends on the release, not on the hook. A declaration nested more than 64 levels deep in package.json, a TOML manifest or an MCP config (an MCP server more than 62) is still judged, and reported without a line; a lockfile entry keeps its line at any depth.
References
- CVE: CVE-2025-59536
- OWASP Agentic Top 10: ASI05 (Unexpected Code Execution (RCE)), ASI09 (Human-Agent Trust Exploitation)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-RCE-03
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-HOOK-RCE-003.md: the page then shows that text, with the registry reference appended under it.