Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command ExecutionGHSA-h4mw-j7qp-8mwm
Fix: anthropics/claude-agent-sdk-python#1123GHSA-h4mw-j7qp-8mwm is a Improper Input Validation vulnerability in claude-agent-sdk. A fix is available for claude-agent-sdk — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-h4mw-j7qp-8mwm.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
claude-agent-sdkReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
The Claude Agent SDK for Python passed the resume option to the Claude CLI without validation, allowing a value beginning with - to be interpreted as a separate CLI flag. An attacker who controlled the resume value could inject an --mcp-config flag defining a stdio MCP server, resulting in arbitrary command execution at CLI startup that bypassed the SDK's permission controls. Exploitation required an application to pass untrusted input as the session ID to resume.
Users are advised to update to the latest version of the claude-agent-sdk package.
Thank you to hackerone.com/moamenmahmood for reporting this issue.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | claude-agent-sdk | all versions | 0.2.121pip install --upgrade 'claude-agent-sdk==0.2.121' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for claude-agent-sdk, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update claude-agent-sdk to 0.2.121 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-h4mw-j7qp-8mwm is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Frequently Asked Questions
Is GHSA-h4mw-j7qp-8mwm in your dependencies?
Find it across PyPI, including transitive dependencies.