Claude Agent SDK: Argument Injection via resume Option Allows Arbitrary Command Execution
Critical severity
GitHub Reviewed
Published
Sep 12, 2026
in
anthropics/claude-agent-sdk-python
•
Updated Oct 16, 2026
Description
Published to the GitHub Advisory Database
Oct 16, 2026
Reviewed
Oct 16, 2026
Last updated
Oct 16, 2026
The Claude Agent SDK for Python passed the
resumeoption to the Claude CLI without validation, allowing a value beginning with-to be interpreted as a separate CLI flag. An attacker who controlled theresumevalue could inject an--mcp-configflag 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.
References