CVE-2026-24053: Claude Code has a Path Restriction Bypass via ZSH Clobber which Allows Arbitrary File Writes
Claude Code before 2.0.74 mishandled ZSH clobber syntax when validating Bash commands. A command could write files outside the working directory without a permission prompt. Exploiting it needs a user on ZSH and untrusted content in the agent's context, such as prompt injection. Fixed in 2.0.74; auto-update users already have it.
Published Feb 3, 2026 · Updated Feb 4, 2026 · Analysis Nov 1, 2026
What an attacker can do
Claude Code restricts file writes made by Bash commands to the current working directory and asks the user before going outside it. The validator that parses the command did not handle ZSH's clobber syntax correctly, so a command using it passed the path check and the write landed elsewhere. The advisory does not publish the exact payload. ZSH's clobber operators override the noclobber option, which suggests the parser misread a redirection target, but the advisory does not confirm that.
Two conditions apply: the user runs ZSH, and the attacker can get untrusted content into the context window. That content may be a file in a cloned repository, a web page the agent fetched, an issue or a tool result carrying injected instructions. The agent then runs the crafted command and the user sees no prompt.
An out-of-directory write can target shell startup files, SSH configuration, Git hooks, scripts on the PATH or other tool configs, so the practical outcome can be code execution later. The CVSS 4.0 vector rates confidentiality, integrity and availability impact as high.
Who is affected
@anthropic-ai/claude-code before 2.0.74, used with ZSH as the shell. Check the version:
claude --versionor:
npm ls -g @anthropic-ai/claude-codeAuto-update users have already received the fix per the advisory. Look closer at pinned versions, shared dev containers and CI images.
@anthropic-ai/claude-code
- Ecosystem
- npm
- Affected
- < 2.0.74
- Fixed in
- 2.0.74
- Check
npm ls @anthropic-ai/claude-code
How to fix it
Upgrade to Claude Code 2.0.74 or later.
npm install -g @anthropic-ai/claude-code@latestThe advisory lists no workaround. Until you upgrade, do not run the agent on untrusted repositories or content, and keep the permission prompts on.
How to tell if you were hit
Check files outside your project directory for unexpected recent changes, especially ~/.zshrc, ~/.ssh, ~/.config, Git hooks and anything on the PATH. Review session transcripts for Bash commands using redirection operators such as >| or >! that point to paths outside the project. Beam records agent shell commands and file access, and its rules can flag writes to sensitive paths outside the project directory.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Due to a Bash command validation flaw in parsing ZSH clobber syntax, it was possible to bypass directory restrictions and write files outside the current working directory without user permission prompts. Exploiting this required the user to use ZSH and the ability to add untrusted content into a Claude Code context window.
Users on standard Claude Code auto-update have received this fix already. Users performing manual updates are advised to update to the latest version.
Claude Code thanks https://hackerone.com/alexbernier for reporting this issue!
Questions
- Am I affected if I use Bash instead of ZSH?
The advisory says exploitation required the user to use ZSH, so a Bash-only setup is not described as affected. Upgrading to 2.0.74 is still the safe course.
- Does CVE-2026-24053 need a prompt injection?
It needs the ability to add untrusted content into Claude Code's context window. Prompt injection through repository files, web content or tool output is the usual way.
- Which version has the fix?
2.0.74. Standard auto-update users already have it.
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 Claude Code vulnerabilities
All Claude Code entriesCVE-2026-88968
Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace
high7.7Nov 9, 2026CVE-2026-86063
Claude Code: Plugin Hash Pin Bypass Allows Bypass of Hash Pinning
high7.5Oct 15, 2026CVE-2026-55607
Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution
high7.7Jul 24, 2026CVE-2026-46406
@anthropic-ai/claude-code has an Insecure Temporary File in /copy Command that Enables Response Disclosure and Symlink-Based File Write
medium4.4Jun 25, 2026CVE-2026-54316
Claude Code: Out-of-Band Data Exfiltration via Pre-Approved HuggingFace Domain in WebFetch
medium9.1Jun 17, 2026CVE-2026-40068
Claude Code: Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution
high7.7Apr 24, 2026
