CVE-2025-54794: @anthropic ai/claude code Claude Code Research Preview Has Vulnerability

HIGH
Advisory Identifier: GHSA-pmw4-pwvc-3hx2
CWE-22
Published
Advisory Summary

CVE-2025-54794 is a HIGH claude code research preview has vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @anthropic ai/claude code libraries in the npm ecosystem. The issue involves claude code research preview has a path restriction bypass which could allow unauthorized file access. Remediation is available by upgrading affected packages to version 0.2.111.

CVE-2025-54794 at a Glance

CVE Identifier CVE-2025-54794
GHSA Identifier GHSA-pmw4-pwvc-3hx2
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product @anthropic ai/claude code
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-54794

To remediate this vulnerability, upgrade all affected @anthropic ai/claude code dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@anthropic-ai/claude-code fixed: 0.2.111
npm install @anthropic-ai/claude-code@0.2.111
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @anthropic-ai/claude-code

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-54794, inspect your project dependencies using npm:

npm ls @anthropic-ai/claude-code

Analyze the terminal output to locate any version of @anthropic ai/claude code in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.111), your application is affected.

Note: The npm ls @anthropic-ai/claude-code command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In @anthropic ai/claude code, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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!

CVE-2025-54794 Affected @anthropic ai/claude code Versions

1 component(s)
Fixed Versions:
0.2.111
Product / Package Ecosystem Affected Versions Fixed Version
@anthropic-ai/claude-code
npm
< 0.2.111
0.2.111

References

Frequently Asked Questions

What is CVE-2025-54794?
CVE-2025-54794 is a security vulnerability in @anthropic ai/claude code involving Claude Code Research Preview has a Path Restriction Bypass which could allow unauthorized file access under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which @anthropic ai/claude code versions are affected?
Affected versions include releases prior to 0.2.111 across affected packages: @anthropic-ai/claude-code.
What version fixes CVE-2025-54794?
Upgrading to 0.2.111 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @anthropic-ai/claude-code affected?
Yes, @anthropic-ai/claude-code is affected in releases prior to 0.2.111. Upgrade your dependency to 0.2.111 or later.
What CWE is associated with CVE-2025-54794?
CVE-2025-54794 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2025-54794?
Run the dependency tree command: 'npm ls @anthropic-ai/claude-code'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pmw4-pwvc-3hx2",
  "modified" : "2025-08-05T17:10:27Z",
  "published" : "2025-08-04T15:15:52Z",
  "aliases" : [ "CVE-2025-54794" ],
  "summary" : "Claude Code Research Preview has a Path Restriction Bypass which could allow unauthorized file access",
  "details" : "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. \n\nUsers 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.\n\nThank you to Elad Beber (Cymulate) for reporting this issue!",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@anthropic-ai/claude-code"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.111"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/anthropics/claude-code/security/advisories/GHSA-pmw4-pwvc-3hx2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54794"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/anthropics/claude-code"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-04T15:15:52Z",
    "nvd_published_at" : "2025-08-05T01:15:41Z"
  }
}