Anthropics claude-agent-sdk-python
Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution
Claude Agent SDK is a Python SDK for Claude Code. Prior to 0.2.121, the resume option is passed to the Claude CLI as a separate token without validation, so a dash-leading value is parsed as an independent CLI flag. An attacker can inject the --mcp-config flag to define a stdio MCP server, causing arbitrary command execution at CLI startup outside the SDK permission controls. The issue is exploitable when an application passes untrusted input as the session ID to resume. This issue is fixed in version 0.2.121.
First public PoC
None yetno public PoC found
Public PoCs00 on GitHub
CVSS9.2critical · scored by CNA · CWE-20
CISA KEV
Not listednot known exploited
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
anthropics claude-agent-sdk-python
- < 0.2.121
Fixed in 0.2.121
Mitigation
Upgrade claude-agent-sdk-python to 0.2.121 or later.
References
- Vendor advisory github.com/anthropics/claude-agent-sdk-python/…
- Patch github.com/anthropics/claude-agent-sdk-python/…
- Patch github.com/anthropics/claude-agent-sdk-python/…
1 more
- Release notes github.com/anthropics/claude-agent-sdk-python/…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.