Input validation error in Claude Code - CVE-2026-40068
Published: April 30, 2026
Claude Code
Anthropic
Description
The vulnerability allows a remote attacker to execute arbitrary code.
The vulnerability exists due to improper input validation in the git worktree commondir trust check when determining folder trust for a crafted repository. A remote attacker can craft a repository with a commondir file pointing to a previously trusted path to execute arbitrary code.
Exploitation requires the victim to clone a malicious repository and run Claude Code within it, and for the attacker to know or guess a path the victim had already trusted.