Vulnerabilities in pkg:pypi/claude-agent-sdk
PACKAGECVE-2026-96620 is a CRITICAL argument injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Claude Agent SDK libraries in the PyPI ecosystem. The issue involves argument injection via resume option allows arbitrary command execution. Remediation is available by upgrading affected packages to version 0.2.121.
pkg:pypi/claude-agent-sdk
Vulnerability advisories affecting package pkg:pypi/claude-agent-sdk. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-h4mw-j7qp-8mwm | CVE-2026-96620 | CRITICAL | Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution |
CVE-2026-96620 at a Glance
How to Fix CVE-2026-96620
To remediate this vulnerability, upgrade all affected Claude Agent SDK dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install claude-agent-sdk>=0.2.121
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show claude-agent-sdk
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-96620, inspect your installed packages using pip:
pip show claude-agent-sdk
Analyze the terminal output to locate any version of Claude Agent SDK in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.121), your application is affected.
Note: The pip show claude-agent-sdk command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Claude Agent SDK, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-96620 Affected Claude Agent SDK Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
claude-agent-sdk
|
PyPI |
< 0.2.121
|
0.2.121
|
References
Frequently Asked Questions
What is CVE-2026-96620?
Which Claude Agent SDK versions are affected?
What version fixes CVE-2026-96620?
Is claude-agent-sdk affected?
What CWE is associated with CVE-2026-96620?
How can I check PyPI dependencies for CVE-2026-96620?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h4mw-j7qp-8mwm",
"modified" : "2026-10-16T19:44:37Z",
"published" : "2026-10-16T19:44:37Z",
"aliases" : [ "CVE-2026-96620" ],
"summary" : "Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution",
"details" : "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.\n\nUsers are advised to update to the latest version of the claude-agent-sdk package.\n\nThank you to hackerone.com/moamenmahmood for reporting this issue.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "claude-agent-sdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.2.121"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/anthropics/claude-agent-sdk-python/security/advisories/GHSA-h4mw-j7qp-8mwm"
}, {
"type" : "WEB",
"url" : "https://github.com/anthropics/claude-agent-sdk-python/pull/1123"
}, {
"type" : "WEB",
"url" : "https://github.com/anthropics/claude-agent-sdk-python/commit/347a1cb88d7652199399db1b7f914e0a459a6662"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/anthropics/claude-agent-sdk-python"
}, {
"type" : "WEB",
"url" : "https://github.com/anthropics/claude-agent-sdk-python/releases/tag/v0.2.121"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-78", "CWE-88" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-16T19:44:37Z",
"nvd_published_at" : null
}
}