CVE-2026-25725
JSON

7.7high

Claude Code Has Sandbox Escape via Persistent Configuration Injection in settings.json

Severity
7.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.53% (higher than 46% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-ff64-7w26-62rf

Description

Claude Code is an agentic coding tool. Prior to version 2.1.2, Claude Code's bubblewrap sandboxing mechanism failed to properly protect the .claude/settings.json configuration file when it did not exist at startup. While the parent directory was mounted as writable and .claude/settings.local.json was explicitly protected with read-only constraints, settings.json was not protected if it was missing. This allowed malicious code running inside the sandbox to create this file and inject persistent hooks (such as SessionStart commands) that would execute with host privileges when Claude Code was restarted. This issue has been patched in version 2.1.2.

Affected

Product or packageVersionsReported by
anthropics claude-code< 2.1.2CVE List
@anthropic-ai/claude-code (npm)before 2.1.2GitHub Advisory Database
anthropic claude_codebefore 2.1.2NVD

All scores

GitHub_M7.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-501CWE-668

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

Claude Code is an agentic coding tool. Prior to version 2.1.2, Claude Code's bubblewrap sandboxing mechanism failed to properly protect the .claude/settings.json configuration file when it did not exist at startup. While the parent directory was mounted as writable and .claude/settings.local.json was explicitly protected with read-only constraints, settings.json was not protected if it was missing. This allowed malicious code running inside the sandbox to create this file and inject persistent hooks (such as SessionStart commands) that would execute with host privileges when Claude Code was restarted. This issue has been patched in version 2.1.2.

GitHub Advisory Database

Claude Code's bubblewrap sandboxing mechanism failed to properly protect the .claude/settings.json configuration file when it did not exist at startup. While the parent directory was mounted as writable and .claude/settings.local.json was explicitly protected with read-only constraints, settings.json was not protected if it was missing. This allowed malicious code running inside the sandbox to create this file and inject persistent hooks (such as SessionStart commands) that would execute with host privileges when Claude Code was restarted.

Users on standard Claude Code auto-update received this fix automatically. Users performing manual updates are advised to update to the latest version.

Claude Code thanks hackerone.com/edbr for reporting this issue!

NVD (es)

Claude Code es una herramienta de codificación agéntica. Antes de la versión 2.1.2, el mecanismo de sandboxing bubblewrap de Claude Code no protegió adecuadamente el archivo de configuración .claude/settings.json cuando no existía al inicio. Si bien el directorio padre estaba montado como escribible y .claude/settings.local.json estaba explícitamente protegido con restricciones de solo lectura, settings.json no estaba protegido si faltaba. Esto permitía que código malicioso ejecutándose dentro del sandbox creara este archivo e inyectara hooks persistentes (como comandos SessionStart) que se ejecutarían con privilegios de host cuando se reiniciara Claude Code. Este problema ha sido parcheado en la versión 2.1.2.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-25725 changed 2026-02-06CVE Terms of Use
GitHub Advisory DatabaseGHSA-ff64-7w26-62rf changed 2026-02-06CC-BY-4.0
NVDCVE-2026-25725 changed 2026-06-17Public domain