Description
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.
Published: 2026-10-16
Score: 9.2 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary Command Execution
Action: Immediate Patch
AI Analysis

Impact

The vulnerability occurs when the Claude Agent SDK passes the resume option to its underlying CLI without input validation. A session ID beginning with a dash is interpreted as an independent flag, permitting an attacker to inject the --mcp-config option and define a malicious stdio MCP server. This enables arbitrary commands to run on the host when the CLI starts, bypassing the SDK's permission controls. The flaw involves unchecked input, command injection, and privilege escalation, corresponding to CWE‑20, CWE‑78, and CWE‑88.

Affected Systems

Anthropics Claude Agent SDK for Python is affected. All releases prior to version 0.2.121 are vulnerable. Versions at or above 0.2.121 contain the fix.

Risk and Exploitability

The CVSS v3 base score is 9.2, indicating critical severity. No EPSS score is published, and the vulnerability is not listed in CISA's KEV catalog, but the lack of public exploitation data does not mitigate the inherent risk. The attack requires that an application provide a malicious session ID to the resume feature; thus, any container or orchestration workload that uses the SDK with untrusted input is at risk. Exploitation is straightforward from local or remote code that controls the session ID, and CLIs that start with the injected flag can spawn arbitrary commands.

Generated by OpenCVE AI on October 16, 2026 at 21:45 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to Claude Agent SDK version 0.2.121 or newer.
  • If upgrading is impractical, validate that any session ID passed to resume does not start with a hyphen and is confined to a safe character set before forwarding to the SDK.
  • Audit application code to ensure that resume parameters are never derived directly from user‑supplied data or otherwise untrusted sources; apply stringent input validation or sanitization routines.

Generated by OpenCVE AI on October 16, 2026 at 21:45 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-h4mw-j7qp-8mwm Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution
History

Fri, 16 Oct 2026 20:00:00 +0000

Type Values Removed Values Added
Description 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.
Title Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution
Weaknesses CWE-20
CWE-78
CWE-88
References
Metrics cvssV4_0

{'score': 9.2, 'vector': '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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-16T19:44:01.260Z

Reserved: 2026-09-23T14:35:50.128Z

Link: CVE-2026-96620

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-16T20:18:28.293

Modified: 2026-10-16T20:18:28.293

Link: CVE-2026-96620

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-16T22:00:16Z

Weaknesses
  • CWE-20

    Improper Input Validation

  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')