Executive brief
Claude Code is an AI-powered terminal tool that assists developers by executing coding tasks and analyzing repositories. The tool supports a permission system to block access to sensitive files (e.g., /etc/passwd). However, an attacker could bypass these restrictions by placing a symbolic link to a restricted file in a repository and crafting misleading comments to trick Claude Code into following the link and exposing sensitive data.
Technical details
Claude Code implements a permission system via settings.json to deny access to sensitive files. However, the application does not properly validate symlink targets against the configured deny rules before dereferencing them (CWE-61, CWE-285). An attacker can create a repository containing a symbolic link pointing to a denied file and craft misleading content (e.g., comments suggesting a "vulnerable function") to prompt the agent to inspect the symlink. When Claude Code follows the symlink, it bypasses permission enforcement, allowing unauthorized file reads. The vulnerability requires network-based repository delivery and user interaction (running Claude Code against the malicious repository) but no special privileges. The impact is limited to confidentiality (reading restricted files) with no integrity or availability impact. Patches are available in version 2.1.7 and later.
Affected products
- Anthropic Claude Code < 2.1.7
Timeline
- 2026-02-06: disclosed: Published on GitHub advisory database
- 2026-02-06: patched: Fixed in Claude Code version 2.1.7 and later