CVE-2025-54794: Claude Code Research Preview has a Path Restriction Bypass which could allow unauthorized file access
Claude Code is an agentic coding tool. In versions below 0.2.111, a path validation flaw using prefix matching instead of canonical path comparison, makes it 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. This is fixed in version 0.2.111.
Other sources
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!
— GitHub
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-54794?
CVE-2025-54794 has been rated as a high severity vulnerability due to its potential for unauthorized file access.
How do I fix CVE-2025-54794?
To fix CVE-2025-54794, update the @anthropic-ai/claude-code package to version 0.2.111 or later.
What does CVE-2025-54794 affect?
CVE-2025-54794 affects the @anthropic-ai/claude-code package specifically up to version 0.2.111.
What types of attacks can CVE-2025-54794 facilitate?
CVE-2025-54794 can facilitate path traversal attacks, allowing unauthorized access to files outside the current working directory.
Is CVE-2025-54794 easy to exploit?
Exploitation of CVE-2025-54794 requires the ability to create a directory with the same prefix as the current working directory, making it moderately difficult.