---
title: "CWE-61: UNIX Symbolic Link (Symlink) Following"
url: https://radicalnotion.ai/cwe/cwe-61
type: cwe
description: "The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-61: UNIX Symbolic Link (Symlink) Following

- **Abstraction:** Compound
- **Structure:** Composite
- **Status:** Incomplete
- **Likelihood of exploit:** High
- **CVEs with this as primary weakness:** 168
- **Of those, in CISA KEV:** 1
- **New in 2026:** 86
- **CWE catalog version:** 4.21

## Description

The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.

## Alternate terms

- Symlink following
- symlink vulnerability

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | These are typically reported for temporary files or privileged programs. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity | Read Files or Directories, Modify Files or Directories | A product that allows a symbolic link (symlink) as part of a path - whether in internal code or through user input - can allow an attacker to spoof the symbolic link and traverse the file system to unintended locations or access arbitrary files. An attacker could read, write, or /corrupt a file that they originally did not have permissions to access directly. |

## Potential mitigations

### Implementation

Symbolic link attacks often occur when a program creates a tmp directory that stores files/links. Access to the directory should be restricted to the program as to prevent attackers from manipulating the files.

### Architecture and Design (Separation of Privilege)

Follow the principle of least privilege when assigning access rights to entities in a software system.

Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-1999-1386 | Some versions of Perl follow symbolic links when running with the -e option, which allows local users to overwrite arbitrary files via a symlink attack. |
| CVE-2000-1178 | Text editor follows symbolic links when creating a rescue copy during an abnormal exit, which allows local users to overwrite the files of other users. |
| CVE-2004-0217 | Antivirus update allows local users to create or append to arbitrary files via a symlink attack on a logfile. |
| CVE-2003-0517 | Symlink attack allows local users to overwrite files. |
| CVE-2004-0689 | Possible interesting example |
| CVE-2005-1879 | Second-order symlink vulnerabilities |
| CVE-2005-1880 | Second-order symlink vulnerabilities |
| CVE-2005-1916 | Symlink in Python program |
| CVE-2000-0972 | Setuid product allows file reading by replacing a file being edited with a symlink to the targeted file, leaking the result in error messages when parsing fails. |
| CVE-2005-0824 | Signal causes a dump that follows symlinks. |
| CVE-2015-3629 | A Libcontainer used in Docker Engine allows local users to escape containerization and write to an arbitrary file on the host system via a symlink attack in an image when respawning a container. |
| CVE-2020-26277 | In a MySQL database deployment tool, users may craft a maliciously packaged tarball that contains symlinks to files external to the target and once unpacked, will execute. |
| CVE-2021-21272 | "Zip Slip" vulnerability in Go-based Open Container Initiative (OCI) registries product allows writing arbitrary files outside intended directory via symbolic links or hard links in a gzipped tarball. |

## Real CVEs with this weakness (sample of 12 of 168)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-54420 | LiteSpeed cPanel Plugin UNIX Symbolic Link (Symlink) Following Vulnerability | high | 8.5 | - | Yes | 2026-06-14 |
| CVE-2024-28189 | Judge0 vulnerable to Sandbox Escape Patch Bypass via chown running on Symbolic Link | critical | 10.0 | - | No | 2024-04-18 |
| CVE-2024-28185 | Judge0 vulnerable to Sandbox Escape via Symbolic Link | critical | 10.0 | - | No | 2024-04-18 |
| CVE-2025-23394 | daily-backup.sh script in cyrus-imapd allows escalation from cyrus to root | critical | 9.8 | - | No | 2025-05-26 |
| CVE-2024-54661 | socat: arbitrary file overwrite via predictable /tmp directory | critical | 9.8 | - | No | 2024-12-04 |
| CVE-2026-55447 | Langflow: BaseFileComponent-based nodes arbitrary file read with RCE exploit | critical | 9.6 | - | No | 2026-06-23 |
| CVE-2025-68937 | forgejo: Forgejo: Server shell access via symlink mishandling in template repositories | critical | 9.5 | - | No | 2025-12-25 |
| CVE-2026-50612 | Import Symlink Following Remote Code Execution Vulnerability in QuMagie | critical | 9.4 | - | No | 2026-10-15 |
| CVE-2026-34078 | Flatpak has a complete sandbox escape leading to host file access and code execution in the host context | critical | 9.3 | - | No | 2026-04-07 |
| CVE-2026-39860 | Nix sandbox escape: file write via symlink at FOD \`.tmp\` copy destination | critical | 9.0 | - | No | 2026-04-08 |
| CVE-2026-118688 | Wasmtime before 36.0.18, 37.0.0 before 48.0.6, and 49.0.0 before 49.0.3 Sandbox Escape via Symlink Rename | high | 8.8 | - | No | 2026-10-28 |
| CVE-2026-115392 | Wasmtime before 24.0.13, 25.0.0 before 36.0.14, 37.0.0 before 46.0.3, and 47.0.0 before 47.0.4 Sandbox Escape via Trailing Slashes | high | 8.8 | - | No | 2026-10-22 |

## Related attack patterns (CAPEC)

- [CAPEC-27](https://radicalnotion.ai/capec/capec-27): Leveraging Race Conditions via Symbolic Links

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-59](https://radicalnotion.ai/cwe/cwe-59) | Improper Link Resolution Before File Access |
| Requires | [CWE-340](https://radicalnotion.ai/cwe/cwe-340) | Generation of Predictable Numbers or Identifiers |
| Requires | [CWE-362](https://radicalnotion.ai/cwe/cwe-362) | Concurrent Execution using Shared Resource with Improper Synchronization |
| Requires | [CWE-386](https://radicalnotion.ai/cwe/cwe-386) | Symbolic Name not Mapping to Correct Object |
| Requires | [CWE-732](https://radicalnotion.ai/cwe/cwe-732) | Incorrect Permission Assignment for Critical Resource |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | UNIX symbolic link following | - | - |

## Frequently asked questions

### What is CWE-61?

The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.

### What CVEs are caused by CWE-61?

168 recorded CVEs are attributed to CWE-61, including CVE-2026-54420, CVE-2024-28189 and CVE-2024-28185. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-61?

Symbolic link attacks often occur when a program creates a tmp directory that stores files/links. Access to the directory should be restricted to the program as to prevent attackers from manipulating the files.

### How is CWE-61 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-61?

Exploiting CWE-61 can lead to: Read Files or Directories, Modify Files or Directories.

### Is CWE-61 actively exploited?

Yes. 1 CWE-61 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 168 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/61.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-61). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
