CVE-2026-25722: Command Injection Vulnerability in @anthropic-ai/claude-code Allows Bypass of Write Protection

@anthropic-ai/claude-code Updated 06 Feb 2026

Summary

06/02/2026
Yes i
High
7.7

CVE-2026-25722: Claude Code Vulnerable to Command Injection via Directory Change Bypasses Write Protection. Affects @anthropic-ai/claude-code versions < 2.0.57. Fixed in 2.0.57. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Claude Code is an advanced coding assistant developed by Anthropic AI, designed to facilitate coding tasks through intelligent suggestions and automation. It integrates seamlessly with various development environments, providing users with enhanced productivity. However, a recent vulnerability has been identified that compromises its security, specifically regarding directory changes and write operations.

Vulnerability Detail

The vulnerability arises from Claude Code's inadequate validation of directory changes when executing write operations in protected folders. By using the 'cd' command to navigate into sensitive directories, such as '.claude', an attacker can bypass the intended write protection. This allows unauthorized creation or modification of files without user consent. Exploiting this vulnerability requires the ability to introduce untrusted content into a Claude Code context window, posing significant risks to user data integrity and confidentiality.

How To Fix

Latest published version: 2.1.308 as of 23 Oct 2026

npm install @anthropic-ai/claude-code@2.1.308

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.0.57

This is the first release that contains the fix.

npm install @anthropic-ai/claude-code@2.0.57

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users are advised to avoid using the 'cd' command to navigate into sensitive directories while using Claude Code until the package is updated.

Conclusion

The CVE-2026-25722 vulnerability in the @anthropic-ai/claude-code package poses a significant risk by allowing command injection that bypasses write protection. Users are strongly encouraged to update to the latest version to mitigate this risk and ensure the integrity of their coding environment.

See every vulnerability recorded for @anthropic-ai/claude-code →

Share this vulnerability

FAQ

CVE-2026-25722 is a vulnerability in the @anthropic-ai/claude-code package that allows command injection, enabling attackers to bypass write protection in sensitive directories.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your package-lock.json for vulnerabilities.

If you cannot update the package right away, avoid using the 'cd' command to navigate into sensitive directories as a temporary measure.

Exploitation of this vulnerability can lead to unauthorized file modifications, data loss, and compromise of sensitive information within the Claude Code environment.

The CVSS score for this vulnerability is 7.7, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for @anthropic-ai/claude-code.

How To Fix

Latest published version: 2.1.308 as of 23 Oct 2026

npm install @anthropic-ai/claude-code@2.1.308

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.0.57

This is the first release that contains the fix.

npm install @anthropic-ai/claude-code@2.0.57

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback