Skip to main content

Claude Agent SDK EUVDEUVD-2026-103155

| CVE-2026-96620 CRITICAL
Improper Input Validation (CWE-20)
2026-10-16 https://github.com/anthropics/claude-agent-sdk-python GHSA-h4mw-j7qp-8mwm
9.2
CVSS 4.0 · Vendor: https://github.com/anthropics/claude-agent-sdk-python
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply crafted session ID to application
  2. Delivery
    Application forwards value to SDK resume option
  3. Exploit
    SDK emits it as separate CLI argument
  4. Execution
    CLI parses injected --mcp-config flag
  5. Impact
    Stdio MCP server executes arbitrary command bypassing permissions

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires the host application to pass untrusted/attacker-controlled input directly into the SDK's resume option (the session ID to resume); this is the explicit precondition named in the advisory and is NOT the default or recommended usage pattern. The injected value must begin with - (e.g. --mcp-config=...) so the Claude CLI treats it as a standalone flag rather than the option's value, exploiting that --resume is declared with an optional value in the two-token argv form. Limiting factors: applications that resume only internally generated or validated session IDs are not exposed; the flaw affects only claude-agent-sdk versions < 0.2.121 and is fully remediated by the bound --resume=value form in 0.2.121. There is no network-exposed default-configuration path independent of how the embedding application handles session IDs.

Impact

No CVSS vector, EPSS score, KEV listing, or SSVC decision data was provided, so several standard prioritization signals are missing and must be stated as such rather than assumed. The vulnerability itself is high-impact - argument injection in the Claude Agent SDK for Python lets an attacker-controlled resume value inject an --mcp-config flag that defines a stdio MCP server, yielding arbitrary command execution at CLI startup and bypassing the SDK's permission controls (CWE-20, Improper Input Validation). However, real-world risk is strongly gated by a non-default precondition: the host application must route untrusted input into the resume/session-ID option, which is not how most applications are built. There is no public exploit identified at time of analysis and no evidence of active exploitation, so this is a serious-but-conditional RCE rather than a confirmed mass-exploitation priority. The fix is confirmed and narrow (switching from the two-token --resume value form to the bound --resume=value form), so remediation is low-cost and should be prioritized for any application that resumes sessions from external input.

Exploit ScenarioDerived

An application built on claude-agent-sdk accepts a session ID from an external/untrusted source (e.g. an HTTP parameter or user-supplied job record) and passes it directly to the SDK's resume option. The attacker supplies a crafted value beginning with - such as --mcp-config=... that the Claude CLI parses as a separate flag defining a stdio MCP server, causing the CLI to execute an attacker-specified command at startup with the privileges of the SDK process. No public proof-of-concept was provided in the input data.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 16, 2026

Argument injection in the Claude Agent SDK for Python (claude-agent-sdk) before 0.2.121 allows remote attackers to achieve arbitrary command execution when an embedding application passes untrusted input into the SDK's resume option. Because --resume is declared by the Claude CLI with an optional value, a session identifier beginning with - is parsed as a separate CLI flag rather than the option's value, letting an attacker inject --mcp-config and register a stdio MCP server that executes arbitrary commands at CLI startup while bypassing the SDK's permission controls. The assessed CVSS:3.1 vector (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H) indicates no authentication is required but exploitation is high-complexity and conditional on the host application forwarding attacker-controlled data as the session ID; a vendor patch is available as version 0.2.121, and no public exploit code was identified at time of analysis.

RemediationAI

Upgrade to claude-agent-sdk 0.2.121 or later (vendor-released patch; release at https://github.com/anthropics/claude-agent-sdk-python/releases/tag/v0.2.121), which adopts the bound --resume=value and --session-id=value argv form so dash-leading values cannot be parsed as separate CLI flags. The fix is documented in advisory GHSA-h4mw-j7qp-8mwm and PR #1123 (commit 347a1cb88d7652199399db1b7f914e0a459a6662). Until patching is possible, the effective compensating control is to stop routing untrusted data into the resume option: validate session identifiers against a strict allowlist (for example, the expected UUID format), reject any value beginning with -, and never accept a session ID directly from an untrusted user or external system. Applications that only resume server-generated session IDs are inherently not exposed, so narrowing the source of session IDs removes the attack path with no functional loss; a broader but more fragile alternative is to sanitize the generated argv before subprocess launch, which carries the trade-off of being bypassable if argument construction changes. Because exploitation requires the host application to pass attacker-controlled input as the session ID, reviewing that data flow is as important as applying the update.

Affected VersionsENISA

claude-agent-sdk-python < 0.2.121

Affected Packages

pypi claude-agent-sdk fix: 0.2.121
euvd claude_agent_sdk_python fix: 0.2.121

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in pypi, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The flaw is an argument-injection issue (CWE-20, improper input validation) in the Python SDK's subprocess transport for the Claude CLI. In src/claude_agent_sdk/_internal/transport/subprocess_cli.py, _build_command() previously emitted the resume option as two separate argv tokens (["--resume", value]). The Claude CLI declares --resume with an optional value, so a value that begins with a dash is not bound to the flag and is instead treated as an independent CLI option. An attacker controlling that value can supply a flag such as --mcp-config pointing to an attacker-defined stdio MCP server; the CLI then spawns that server's command at startup, giving arbitrary command execution that occurs outside the SDK's permission-control layer. The same two-token construction was used for --session-id. The upstream fix (PR #1123, commit 347a1cb88d7652199399db1b7f914e0a459a6662) switches both options to the bound --flag=value form so the value can never detach into a standalone argv flag, and the CLI subsequently rejects the malformed value as an invalid session ID. Test additions explicitly assert that dash-leading values no longer appear as separate tokens.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/anthropics/claude-agent-sdk-python) PRIMARY 9.2 CRITICAL
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
vuln.today AI 8.1 HIGH

Arbitrary command execution gives C/I/A High and no SDK auth gives PR:N, but exploitation depends on the application routing untrusted input into resume (a condition outside the attacker's control), so AC:H.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/anthropics/claude-agent-sdk-python).

CVSS VectorVendor: https://github.com/anthropics/claude-agent-sdk-python

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
Oct 16, 2026 - 20:42 NVD
9.2 (CRITICAL)
CVE Published
Oct 16, 2026 - 19:44 cve.org
CRITICAL

DescriptionCVE.org

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.

Technical POC Analysis

CWE-20 Improper Input Validation, specifically argument injection (advisory also lists CWE-88).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A critical vulnerability in the Claude Agent SDK for Python (versions before 0.2.121) allows an attacker to execute arbitrary commands on any host system running an application built with this SDK, whenever that application forwards untrusted input as a session identifier. Because the flaw can be triggered remotely without authentication and yields full compromise of confidentiality, integrity, and availability, any business unit shipping or operating agent-based tooling, developer automation, or customer-facing AI services on this SDK is exposed. Leadership should treat this as a priority remediation item given the potential for downstream compromise of build pipelines, internal systems, and customer data.

Business Impact: High
Compensating Controls

Apply vendor patch. Given the vendor-released fix in claude-agent-sdk 0.2.121 is available, patching is the primary control; where immediate upgrade is not possible, interim mitigations include blocking untrusted input from reaching the resume option, validating and allow-listing session identifiers to reject values starting with a hyphen, running affected applications with least-privilege service accounts and restricted MCP configuration paths, and monitoring CLI startup for unexpected --mcp-config or stdio MCP server registration. No public exploit code was identified at time of analysis.

Threat Intelligence Overview

Prevalence
Low
newer developer-focused Python SDK, limited production deployment footprint
Threat Intel
1
1 source
Social Media
2
Sightings
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy