NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-96620: Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution

criticalCVSS 4.0 9.2GHSA-h4mw-j7qp-8mwm

The Claude Agent SDK for Python before 0.2.121 passed the `resume` option to the Claude CLI unvalidated. A value starting with `-` became a CLI flag, so an attacker could inject `--mcp-config` with a stdio MCP server and run arbitrary commands at CLI startup. Upgrade claude-agent-sdk to 0.2.121.

Published Oct 16, 2026 · Analysis Oct 28, 2026

What an attacker can do

The SDK builds a command line for the Claude CLI and appended the resume session ID as an argument. If the value begins with -, the CLI parses it as its own option instead of a session ID. This is argument injection (CWE-88).

An attacker who controls that value can supply --mcp-config pointing at a config that defines a stdio MCP server. The CLI starts that server as a process when it launches, which means the attacker's command runs on the host. This happens at startup and so bypasses the SDK's permission controls, which only apply to tool use during the session.

Exploitation needs an application that passes untrusted input as the session ID to resume. A web backend or chat service that takes a session ID from a request, URL or database field and hands it to the SDK is the typical case. Apps that generate session IDs themselves are not exposed. The impact is code execution as the user running the SDK, with access to its API keys, source code and environment.

Who is affected

The pip package claude-agent-sdk, all versions below 0.2.121. Check how your code sets resume in the options: if any part comes from user input, a request or an untrusted store, you are exposed.

pip show claude-agent-sdk

claude-agent-sdk

Ecosystem
PyPI
Affected
< 0.2.121
Fixed in
0.2.121
Check
pip show claude-agent-sdk

How to fix it

Upgrade to claude-agent-sdk 0.2.121:

pip install --upgrade claude-agent-sdk==0.2.121

The fix is in pull request 1123 (commit 347a1cb). Also validate session IDs in your own code before passing them on: accept only the UUID format your app issues and reject anything beginning with -. The advisory gives no other workaround.

How to tell if you were hit

Search application logs and request records for resume or session ID values beginning with -, especially ones containing --mcp-config. On the host, look for unexpected child processes of the Claude CLI at startup and for MCP config files or stdio server commands you did not write. Beam records agent shell commands and MCP tool calls, so an unexpected server launched by an agent run shows up there.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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.

Questions

Does the attacker need to be authenticated?

That depends on your app. The flaw needs only that untrusted input reaches the resume option. The CVSS 4.0 vector has no privileges required but notes an attack-requirements precondition.

Does the SDK's permission mode stop it?

No. The injected MCP server starts at CLI startup, before permission controls apply, so it bypasses them.

Which version fixes CVE-2026-96620?

claude-agent-sdk 0.2.121. Everything below it is affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries