CVE-2026-35021: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Anthropic Claude Code
Anthropic Claude Code CLI and Claude Agent SDK contain an OS command injection vulnerability in the prompt editor invocation utility that allows attackers to execute arbitrary commands by crafting malicious file paths. Attackers can inject shell metacharacters such as $() or backtick expressions into file paths that are interpolated into shell commands executed via execSync. Although the file path is wrapped in double quotes, POSIX shell semantics (POSIX §2.2.3) do not prevent command substitution within double quotes, allowing injected expressions to be evaluated and resulting in arbitrary command execution with the privileges of the user running the CLI.
AI Analysis
Technical Summary
CVE-2026-35021 is an OS command injection vulnerability in Anthropic Claude Code CLI and Claude Agent SDK. The issue arises in the prompt editor invocation utility where file paths containing shell metacharacters such as $() or backticks are interpolated into shell commands executed via execSync. Because POSIX shell semantics allow command substitution within double quotes, attackers can craft malicious file paths that result in arbitrary command execution with the privileges of the user running the CLI. This vulnerability is classified under CWE-78 and has a CVSS 4.0 score of 8.4, indicating high severity. The affected product is not a cloud service, and no patch or official remediation level has been disclosed.
Potential Impact
Successful exploitation of this vulnerability allows an attacker to execute arbitrary operating system commands with the privileges of the user running the Anthropic Claude Code CLI or Agent SDK. This can lead to unauthorized system access, data compromise, or further system manipulation. The vulnerability does not require privileges or authentication but does require user interaction (UI:A). There are no known exploits in the wild currently.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, users should avoid running the vulnerable prompt editor invocation utility with untrusted input or file paths. Restricting usage to trusted environments and users may reduce risk. Monitor vendor channels for updates and apply patches promptly once available.
CVE-2026-35021: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Anthropic Claude Code
Description
Anthropic Claude Code CLI and Claude Agent SDK contain an OS command injection vulnerability in the prompt editor invocation utility that allows attackers to execute arbitrary commands by crafting malicious file paths. Attackers can inject shell metacharacters such as $() or backtick expressions into file paths that are interpolated into shell commands executed via execSync. Although the file path is wrapped in double quotes, POSIX shell semantics (POSIX §2.2.3) do not prevent command substitution within double quotes, allowing injected expressions to be evaluated and resulting in arbitrary command execution with the privileges of the user running the CLI.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-35021 is an OS command injection vulnerability in Anthropic Claude Code CLI and Claude Agent SDK. The issue arises in the prompt editor invocation utility where file paths containing shell metacharacters such as $() or backticks are interpolated into shell commands executed via execSync. Because POSIX shell semantics allow command substitution within double quotes, attackers can craft malicious file paths that result in arbitrary command execution with the privileges of the user running the CLI. This vulnerability is classified under CWE-78 and has a CVSS 4.0 score of 8.4, indicating high severity. The affected product is not a cloud service, and no patch or official remediation level has been disclosed.
Potential Impact
Successful exploitation of this vulnerability allows an attacker to execute arbitrary operating system commands with the privileges of the user running the Anthropic Claude Code CLI or Agent SDK. This can lead to unauthorized system access, data compromise, or further system manipulation. The vulnerability does not require privileges or authentication but does require user interaction (UI:A). There are no known exploits in the wild currently.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, users should avoid running the vulnerable prompt editor invocation utility with untrusted input or file paths. Restricting usage to trusted environments and users may reduce risk. Monitor vendor channels for updates and apply patches promptly once available.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-03-31T20:40:15.618Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69d409d70a160ebd92d5a933
Added to database: 4/6/2026, 7:30:31 PM
Last enriched: 4/14/2026, 11:23:46 AM
Last updated: 5/22/2026, 12:02:10 PM
Views: 71
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.