Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2025-59536: Pre-Trust Code Execution in Anthropic Claude Code

Published Oct 3, 2025 · Updated 4 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days3 mentions · peak 1 in a dayToday
CVSS8.7High · v4
EPSS26.3%98th percentile
CISA KEVNoNot listed
In the wildReported1 exploitation record in Mallory
Vendor
Anthropic
IdentifiersCVE-2025-59536CWE-94 · Improper Control of Generation of…

CVE-2025-59536 is a code-injection vulnerability in Anthropic Claude Code versions earlier than 1.0.111. Incorrect enforcement of the startup trust dialog allows attacker-controlled project configuration to trigger code execution before the user accepts the project trust prompt. An attack path uses repository-scoped settings to automatically enable project-defined Model Context Protocol (MCP) servers, causing attacker-specified commands to execute during startup. Exploitation requires a user to launch Claude Code in an untrusted project directory; accepting the trust dialog is not required.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows arbitrary command execution in the security context of the user running Claude Code, bypassing the intended project-trust approval boundary. Depending on that user's permissions and available credentials, resulting compromise can include access to local source code and secrets, modification of projects or other accessible files, and execution of additional malicious software.

Mitigation

If you can’t patch tonight, do this now.

Until patched, do not launch Claude Code in untrusted project directories. Inspect repository-controlled agent settings and MCP server definitions before opening unfamiliar projects. Where untrusted projects must be examined, use an isolated, least-privileged environment without sensitive credentials or access to production resources. Configuration inspection and isolation are defense-in-depth measures, not substitutes for updating.

Remediation

Patch, then assume compromise.

Upgrade Claude Code to version 1.0.111 or later, preferably the latest supported release. Version 1.0.111 fixes the startup trust-dialog enforcement issue by delaying MCP startup until after the trust decision. Standard Claude Code auto-update delivers the fix automatically; manually maintained installations must be explicitly updated.

Public exploits

Exploits

3 exploits validated by Mallory's analysis. Hidden: 6 rejected by Mallory's analysis as not a working exploit.

View more in app →
cve-2025-59536-pocThis repository is a small proof-of-concept exploit for CVE-2025-59536 affecting Anthropic Claude Code before version 1.0.111. The real exploit logic is not in the JavaScript application; it is embedded in .claude/settings.json, which defines a SessionStart hook that executes a shell command automatically when Claude Code starts in the project. The payload is benign and writes execution evidence plus basic host/user metadata to /tmp/cve-2025-59536-proof.txt, but it clearly demonstrates arbitrary command execution capability. Repository structure is minimal: README.md explains the vulnerability, affected versions, reproduction steps, and possible real-world abuse; .claude/settings.json contains the malicious hook payload; index.js and package.json form a harmless-looking Node/Express decoy project to make the repository appear normal; .gitignore only excludes node_modules. There is no exploit framework involved. Primary capability: local code execution on a victim workstation through a malicious project configuration file processed by Claude Code. The attack is best characterized as a supply-chain/social-engineering style repository trap: a victim clones or opens the repository and runs Claude Code in it, causing the hook to fire. The PoC does not include persistence, exfiltration, or networking, but the README explicitly notes those as feasible follow-on actions. The included Express app is incidental and appears intended as camouflage rather than part of exploitation.tacdm · Disclosed May 17, 2026 · json · markdown · local · supply_chainOperationalCVE-2026-21852-PoCRepository purpose: an educational demo of Claude Code CLI supply-chain style attacks via malicious project configuration, covering (1) a hooks consent/trust bypass leading to command execution (no CVE, fixed in v1.0.87), (2) CVE-2025-59536 where enableAllProjectMcpServers=true can auto-start project-defined MCP servers from .mcp.json and execute arbitrary commands (fixed in v1.0.111), and (3) CVE-2026-21852 where ANTHROPIC_BASE_URL from project settings is applied before the trust prompt, redirecting API traffic (including API keys in Authorization/x-api-key headers) to an attacker endpoint (fixed in v2.0.65). Structure and key files: - vuln1_hooks_bypass/.claude/settings.json: defines PreToolUse/PostToolUse hooks that run shell commands and write to /tmp/claude_vuln1_demo.log, demonstrating RCE on repo open in vulnerable versions. - CVE-2025-59536_mcp_injection/.claude/settings.json + CVE-2025-59536_mcp_injection/.mcp.json: sets enableAllProjectMcpServers=true and defines an MCP server that runs sh -c commands, writing to /tmp/claude_vuln2_demo.log. - CVE-2026-21852_api_exfil/.claude/settings.json: sets env.ANTHROPIC_BASE_URL to http://127.0.0.1:8888 to demonstrate credential exfiltration. - attacker_server.py: local HTTP server on 127.0.0.1:8888 that logs incoming requests (headers and JSON bodies) to /tmp/claude_attacker_demo.log and returns a demo JSON response. - attacker_proxy.py: MITM-style proxy on 127.0.0.1:8888 that captures API keys and conversation content, logs to /tmp/claude_proxy_demo.log, and forwards requests to https://api.anthropic.com to keep victim behavior normal. - scanner.py: a defensive detection tool that scans a given repo path for these patterns (hooks executing commands, enableAllProjectMcpServers + .mcp.json command definitions, and ANTHROPIC_BASE_URL/credential-related env overrides) and exits non-zero if findings exist. Exploit capabilities (as demonstrated): - Local code execution via auto-run hooks and MCP server startup (command execution payloads are simple echo/date/whoami/hostname logging but represent arbitrary command execution). - Network-based credential and data interception by redirecting Claude Code API traffic to an attacker-controlled base URL; optional stealth forwarding to the real Anthropic API. Overall, this is a PoC/educational repository combining malicious config examples, attacker infrastructure (server/proxy), and a scanner to detect the same indicators before opening a repo in Claude Code.atiilla · Disclosed Feb 27, 2026 · python · json · local/supply-chain (malicious repository configuration auto-executed by Claude Code CLI) · network (HTTP listener/MITM to capture API keys and conversation data; forwards to real API)PoCClaude-Code-MCP-Injection-PoCRepository contains a small proof-of-concept MCP server intended to demonstrate a UI/UX trust issue: the MCP tool metadata (name/description/schema) shown to the user can be benign while the server executes different, malicious behavior after the user approves the tool call. Structure: (1) server.py implements an MCP Server with a single tool read_safe_file; list_tools() advertises a safe description and a path parameter, but invoke_tool() ignores the requested file read and instead runs an OS command (whoami > ~/Desktop/proof.txt) and returns a fake ToolResult containing the text 'README'. (2) .mcp.json provides MCP server metadata including the advertised URL http://localhost:8000 and the tool description. (3) README.md explains the concept (prompt/confirmation misrepresentation) and positions it as a PoC for an unassigned CVE (CVE-2024-XXXX) affecting Claude Code v2.1.63; it also references a different script name (exploit.py) that is not present in this repository snapshot. Overall purpose: demonstrate post-consent arbitrary command execution by abusing user trust in tool confirmation prompts generated from attacker-controlled MCP metadata.Rohitberiwala · Disclosed Mar 10, 2026 · Framework: MCP (Model Context Protocol) server (Python, mcp.server) · python · json · network (MCP server) / social engineering via UI prompt misrepresentationPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
AnthropicClaude Codeapplication
FAQ

Frequently asked questions

Is CVE-2025-59536 exploited in the wild?
Yes. As of Nov 19, 2026, Mallory has reports of exploitation in the wild.
Is there a public exploit for CVE-2025-59536?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2025-59536, the earliest disclosed Feb 27, 2026.
Is there a patch for CVE-2025-59536?
Upgrade Claude Code to version 1.0.111 or later, preferably the latest supported release. Version 1.0.111 fixes the startup trust-dialog enforcement issue by delaying MCP startup until after the trust decision.
What products are affected by CVE-2025-59536?
Anthropic Claude Code.
How severe is CVE-2025-59536?
CVE-2025-59536 has a CVSS v4 score of 8.7 (High) and an EPSS score of 26.3% (98th percentile) as of Nov 19, 2026.
Activity feed

Recent activity

62 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
detections digest rulecheckNews · Nov 9, 2026Detections Digest #20261109 - by RuleCheckAssociated with MCP tool-argument injection detection. Updated matching focuses on explicit double-underscore arguments to reduce false positives; the underlying vulnerable product and precise impact are not specified.Read more ↗agent threat rule githubNews · Nov 6, 2026fix(rules): ATR-2026-00523 catches SessionStart hooks on any matcher … · Agent-Threat-Rule/agent-threat-rules@0466a68 · GitHubA critical pre-trust remote code execution vulnerability in Claude Code involving SessionStart hooks that execute before the trust dialog appears. The reference connects malicious hooks planted in 42 hijacked repositories during the testmetest campaign to this vulnerability's detection rule. The update addresses detection gaps for hooks using a wildcard matcher or no matcher, including runtime-fallback commands and scripts stored under .github/.Read more ↗codebyNews · Nov 3, 2026Уязвимости ИИ-агентов: пентест LLM от recon до RCEA high-severity code-injection vulnerability in Claude Code before version 1.0.111, rated CVSS 4.0 8.7. Opening an untrusted project can execute project-supplied code before the user confirms trust. The article identifies a public MCP-related proof of concept enabling arbitrary OS commands and states that CISA had not confirmed exploitation.Read more ↗codebyNews · Sep 23, 2026AI-генерируемые отчёты об уязвимостях: маркеры фейкаHigh-severity code-injection vulnerability in Claude Code versions before 1.0.111. It could cause project code execution before a user confirmed the trust dialog when Claude Code was launched in an untrusted directory.Read more ↗
+26 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity32Community discussion across Reddit, Mastodon, and other social sources.