Vulnerabilities in pkg:pypi/claude-agent-sdk

PACKAGE
Advisory Identifier: GHSA-h4mw-j7qp-8mwm
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/claude-agent-sdk

1 Known Advisory Record(s)

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

CVE Identifier CVE-2026-96620
GHSA Identifier GHSA-h4mw-j7qp-8mwm
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Claude Agent SDK
Package Ecosystem PyPI
Published Date
Last Updated

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.

claude-agent-sdk fixed: 0.2.121
pip install claude-agent-sdk>=0.2.121
Verify Direct and Transitive Dependencies

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

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.

CVE-2026-96620 Affected Claude Agent SDK Versions

1 component(s)
Fixed Versions:
0.2.121
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?
CVE-2026-96620 is a security vulnerability in Claude Agent SDK involving Argument Injection via resume Option Allows Arbitrary Command Execution under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Claude Agent SDK versions are affected?
Affected versions include releases prior to 0.2.121 across affected packages: claude-agent-sdk.
What version fixes CVE-2026-96620?
Upgrading to 0.2.121 (or the latest patched release for your respective branch) resolves the vulnerability.
Is claude-agent-sdk affected?
Yes, claude-agent-sdk is affected in releases prior to 0.2.121. Upgrade your dependency to 0.2.121 or later.
What CWE is associated with CVE-2026-96620?
CVE-2026-96620 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (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.).
How can I check PyPI dependencies for CVE-2026-96620?
Run the dependency tree command: 'pip show claude-agent-sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}