CWE-61: UNIX Symbolic Link (Symlink) Following
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.
A product that allows UNIX symbolic links (symlink) as part of paths 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. The symbolic link can permit an attacker to read/write/corrupt a file that they originally did not have permissions to access.
Consequences
- Confidentiality, Integrity: Read Files or Directories, Modify Files or Directories
How to prevent it
- 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: 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.
Recent advisories
- GHSA-hjqx-j4rw-g7xv — zip: Arbitrary file write outside the extraction directory, because ZipArchive::extract validates symlink targets lexically.
- GHSA-p8v3-89rh-jxc7 — Nginx UI: Backup restore follows crafted symlinks into the live Nginx configuration path before restore flags are applied
- GHSA-f794-5jv7-7672 — NLTK: Downloader.download follows hardlinks and overwrites outside-root files
- RUSTSEC-2026-0269 — Filesystem sandbox escape when paths or symlinks contain trailing slashes
- GO-2026-4970 — Root escape via symlink plus trailing slash in os
- GHSA-jmr9-qjv8-65gv — extract-zip unvalidated symlink path traversal
- GHSA-89mr-xqfv-758m — Gogs: UploadRepoFiles writes outside repo working tree via committed parent sym
- GHSA-ccv6-r384-xp75 — Langflow: BaseFileComponent-based nodes arbitrary file read with RCE exploit
- GO-2026-5622 — Arbitrary host CRI log file read via symlink following in CRI checkpoint restore
- CVE-2026-54420 — LiteSpeed cPanel plugin before 2.4.8 (as distributed in LiteSpeed WHM PlugIn before 5.3.2.0) mishandles symlinks provided by a user with FTP or web shell…
- GHSA-jq42-7mfv-hm57 — Cargo crates in third party registries can override the cached source of other crates
- GHSA-rg2x-37c3-w2rh — Docker: Race condition in docker cp allows bind mount redirection to host path
- GHSA-vp62-88p7-qqf5 — Docker: Race condition in docker cp allows creation of arbitrary empty files on the host via symlink swap
- GHSA-hr4r-fwpv-c95j — pgAdmin 4 File Manager has symbolic-link path traversal
- GHSA-35mw-5vvr-vrxc — OpenClaw contains a symlink traversal vulnerability
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor