Summary
Claude Code contained a logic flaw where deny rules configured in settings.json were not strictly enforced when accessing files via symbolic links.
If a user denied access to specific files (for example, /etc/passwd) but Claude Code could reach those files through a symlink it was allowed to open, the tool could still read the restricted content, effectively bypassing the intended access controls.
Affected context
This vulnerability arises in environments where Claude Code is used with customized file-access deny rules defined in settings.json.
The issue manifests when:
- A file path is explicitly denied in the configuration, and
- There exists a symbolic link (within an allowed path) pointing to that denied file.
In such setups, Claude Code may treat the symlink path as allowed and access the underlying target file despite the deny rule.
Exploit preconditions
- Attack surface: File system access performed by Claude Code on behalf of a user or integrated workflow.
- Required access: Ability to configure or influence project directories and create or place symbolic links within paths Claude Code is permitted to read.
- Trigger point: Claude Code attempts to read a file via a symlink in an allowed directory that resolves to a path explicitly listed in the deny rules.
- Why exploitation is possible: Deny rules are evaluated against the apparent path or configuration-level rules without robust normalization and resolution of symbolic links to their real target paths before enforcing access controls.
Why this happens
The underlying defect is an access control enforcement logic issue in the presence of symbolic links.
While deny rules were applied to explicit file paths specified in settings.json, the implementation did not consistently resolve symlinks to their canonical targets before checking those rules.
This maps to CWE-61: Untrusted Search Path / Improper Restriction of Symlink Following and relates to CWE-285: Improper Authorization, because the authorization decision was made on an incomplete or non-canonical view of the path, allowing a symlink to circumvent the path-based restriction.
Potential impact
- Unauthorized reading of sensitive system files that users attempted to deny, such as /etc/passwd or configuration files.
- Exposure of secrets, keys, or credentials stored in files presumed to be blocked by deny rules.
- Leakage of project-internal or organizational data that should have been off-limits to the tool.
- Undermining user trust in access control settings and policy enforcement within development environments.
General mitigation guidance
Effective mitigation patterns focus on enforcing access control against canonical file paths and minimizing trust in filesystem indirections:
- Normalize and resolve file paths (including symbolic links, relative paths, and mount points) to a canonical form before evaluating allow/deny rules.
- Treat symbolic links conservatively, for example by enforcing deny rules on the resolved target, not just the symlink path.
- Implement a single, central authorization check for all file reads, ensuring that all code paths go through the same policy enforcement logic.
- Favor deny-by-default strategies where possible, limiting access to a minimal set of explicitly allowed directories.
- Consider sandboxing strategies (such as chroot-like environments, containers, or virtual workspaces) to isolate the tool's view of the filesystem from sensitive host paths.
How teams detect issues like this
To identify and manage similar issues, organizations can:
- Use static analysis or code review to locate file-access logic that does not normalize paths or resolve symlinks before making authorization decisions.
- Establish coding guidelines that require all filesystem access to pass through a vetted authorization layer, with explicit checks for symlink resolution.
- Add automated tests that simulate symlinks pointing to denied or restricted files and verify that policy enforcement still blocks access.
- Employ runtime monitoring or logging of tool-initiated file accesses to detect anomalous reads of sensitive files despite configured restrictions.

