Browse / Tool and Agent Misuse / CVE-2025-59041
Claude Code vulnerable to arbitrary code execution caused by maliciously configured git email
- Class
- Tool and Agent Misuse (filed by a model that read the advisory)
- Technique
- Code and command execution
- Affected
- @anthropic-ai/claude-code (npm)
- Gets past
- Approval or confirmation prompt
- CVSS
- CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- EPSS
- 0.5% chance of exploitation in 30 days
How it works, in short
A malicious git user.email value in a repository's config is interpolated into a startup shell command, running it before the user accepts the workspace trust dialog. (Our summary, written by a model. The source text is below.)
Details
At startup, Claude Code constructed a shell command that interpolated the value of git config user.email from the current workspace. If an attacker controlled the repository’s Git config (e.g., via a malicious .git/config) and set user.email to a crafted payload, the unescaped interpolation could trigger arbitrary command execution before the user accepted the workspace-trust dialog. The issue affects versions prior to 1.0.105. The fix in 1.0.105 avoids executing commands built from untrusted configuration and properly validates/escapes inputs.
- Patches: Update to
@anthropic-ai/claude-code1.0.105or later. - Workarounds: Open only trusted workspaces and inspect repository
.git/configbefore launch; avoid inheriting untrusted Git configuration values.
> Thank you to the NVIDIA AI Red Team for reporting this issue!
References
- https://github.com/anthropics/claude-code/security/advisories/GHSA-j4h9-wv2m-wrf7
- https://nvd.nist.gov/vuln/detail/CVE-2025-59041
- https://github.com/anthropics/claude-code
- https://www.npmjs.com/package/@anthropic-ai/claude-code/v/1.0.105
Source: GitHub Advisory Database, used under CC BY 4.0.