---
id: "CVE-2026-96620"
kind: "vulnerability"
aliases: ["CVE-2026-96620", "GHSA-h4mw-j7qp-8mwm"]
title: "Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution"
severity: "critical"
cvss: 9.2
epss: 0.005779999773949385
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "claude-agent-sdk", "fixed": ["0.2.121"], "affected": "< 0.2.121", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["ai-agents", "ai-tooling", "claude-agent-sdk", "cwe-20", "cwe-78", "cwe-88", "mcp", "python"]
not_affected_if: ["default-config", "no-untrusted-session-id", "version-0.2.121-or-later"]
published_at: "2026-10-16T19:44:37+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T21:57:14+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-h4mw-j7qp-8mwm", "first_seen_at": "2026-10-23T19:11:32+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-96620", "first_seen_at": "2026-10-23T21:57:14+00:00"}]
---

# Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution

The Claude Agent SDK for Python passed the resume option to the Claude CLI without validation, so a value starting with a dash was read as a CLI flag. An attacker who controls the resume session ID can inject an --mcp-config flag that starts an attacker-defined stdio MCP server, running arbitrary commands on the host.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:claude-agent-sdk affected < 0.2.121 fixed 0.2.121

## How to check

pip show claude-agent-sdk (version below 0.2.121 is affected)
Find code that passes user-supplied input as the resume or session ID argument to ClaudeAgentOptions or query

## Fix

Upgrade claude-agent-sdk to 0.2.121 or later
Validate or reject session IDs that begin with '-' until upgraded

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-h4mw-j7qp-8mwm
- 2026-10-23T21:57:14+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-96620

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
