NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Claude Code

CVE-2025-54794: Claude Code Research Preview has a Path Restriction Bypass which could allow unauthorized file access

highCVSS 4.0 7.7GHSA-pmw4-pwvc-3hx2

Claude Code's directory restriction checked paths with a string prefix match instead of a canonical path comparison. A path in a sibling directory sharing the working directory's name prefix could pass the check, giving access to files outside the project. The npm package @anthropic-ai/claude-code is affected before 0.2.111. Upgrade to 0.2.111 or later.

Published Aug 4, 2025 · Updated Aug 5, 2025 · Analysis Nov 1, 2026

What an attacker can do

Claude Code limits file access to the current working directory (CWD). The flawed check only tested whether the requested path started with the CWD string. If the CWD is /home/user/project, a directory such as /home/user/project-secrets starts with the same text and passes. The advisory does not give this example, but it shows the mechanism.

Two conditions are needed. A directory with the same prefix as the CWD must already exist, or the attacker must be able to create one. And the attacker must get untrusted content into the agent's context window, for example through a file, web page or tool output the agent reads. The attacker needs no privileges, and the CVSS vector shows passive user interaction.

If both hold, a prompt injection can steer the agent to read or write files in the neighboring directory without the usual restriction. The advisory rates confidentiality, integrity and availability impact as high. For a developer machine, sibling directories often hold other repositories, credentials or deployment files.

Who is affected

The advisory lists @anthropic-ai/claude-code versions before 0.2.111 as affected. It also says current users are unaffected, because versions before 1.0.24 are deprecated and were forced to update. These two statements differ, so check your own install instead of relying on either.

claude --version
npm ls -g @anthropic-ai/claude-code

Anyone running a pinned or offline copy of an old build should check it.

@anthropic-ai/claude-code

Ecosystem
npm
Affected
< 0.2.111
Fixed in
0.2.111
Check
npm ls @anthropic-ai/claude-code

How to fix it

Update to @anthropic-ai/claude-code 0.2.111 or later. Users on the standard auto-update received the fix after release.

npm install -g @anthropic-ai/claude-code@latest

The advisory lists no workaround other than updating. Until you can, avoid giving the agent untrusted content in a directory whose name is a prefix of other directories you care about.

How to tell if you were hit

Review agent session history and file-access records for reads or writes outside the project directory, especially in paths that begin with the project's own directory name, such as project-backup or project-secrets. Check whether any such sibling directories exist beside your repositories. Look for prompts or files that contain instructions pointing the agent at those paths. Beam records agent shell commands and file access through its hooks, so you can search its local records for paths outside the working directory.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Due to a path validation flaw using prefix matching instead of canonical path comparison, it was possible to bypass directory restrictions and access files outside the CWD. Successful exploitation depends on the presence of (or ability to create) a directory with the same prefix as the CWD and the ability to add untrusted content into a Claude Code context window.

Users on standard Claude Code auto-update received this fix automatically after release. Current users of Claude Code are unaffected, as versions prior to 1.0.24 are deprecated and have been forced to update.

Thank you to Elad Beber (Cymulate) for reporting this issue!

Questions

Is current Claude Code affected by CVE-2025-54794?

The advisory says current users are unaffected because old versions were forced to update, and lists 0.2.111 as the fixed version. Check claude --version to confirm you are at or above it.

What does an attacker need for this path bypass?

A directory sharing the CWD's name prefix (existing or creatable), and a way to put untrusted content in the agent's context. No privileges are needed, but the user must interact passively, such as opening the content.

Is it exploited in the wild?

None of the sources we read say so, and it is not in CISA's catalog data we hold. Elad Beber of Cymulate reported 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 entries