/

CVE-2026-25724

Severity:

HIGH RISK

(7.5)

Access Control Bypass via Symbolic Links in Claude Code

CVE-2026-25724

Modified

Vulnerability type

Category:

Access Control Bypass via Symbolic Links

CWE:

CWE-61, CWE-285

Impact:

Unauthorized File Read / Access Control Bypass

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/anthropics/claude-code/security/advisories/GHSA-4q92-rfm6-2cqx
terra.securityterra.security/blog/when-ai-becomes-the-attack-surface-lessons-from-discovering-cve-2026-25724

Frequently asked

questions

Exploitation generally occurs within the environment where Claude Code is running. An attacker would typically need the ability to influence the project workspace or filesystem layout (for example by placing symlinks) used by Claude Code. In shared or multi-user environments, this influence might be gained remotely or through collaboration channels.

The attacker needs sufficient access to create or control symbolic links inside directories that Claude Code can read, or to persuade a user to open a workspace containing such symlinks. They do not need direct access to the ultimately restricted file if the symlink is already in place and the tool follows it.

The safest pattern is to normalize and canonicalize all file paths (resolving symlinks) before applying access control rules, and to centralize authorization checks so every file read goes through one hardened, well-tested decision point. Deny rules should be applied to the resolved target path, not just the user-facing path.

Organizations can enforce secure filesystem access patterns in coding standards, mandate path canonicalization in authorization logic, add regression tests for symlink and path-bypass scenarios, and use code scanning tools or manual reviews focused on access control boundaries and path handling. Combining these with sandboxing and least-privilege filesystem exposure greatly reduces the risk of similar bypasses.

Find out what's already
exploitable in your codebase.