Katalog CWE

CWE-59 · Słabość

Improper Link Resolution Before File Access ('Link Following')

Abstrakcja
Bazowa
Status
Szkic
Ryzyko wykorzystania
średnie
Dodano
19 lipca 2006
Ostatnia zmiana
11 grudnia 2025

Podatności CVE z tą słabościąPełny wpis na cwe.mitre.org ↗

Opis

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Inne nazwy

insecure temporary file
Some people use the phrase "insecure temporary file" when referring to a link following weakness, but other weaknesses can produce insecure temporary files without any symlink involvement at all.
Zip Slip
"Zip slip" is an attack that uses file archives (e.g., ZIP, tar, rar, etc.) that contain filenames with path traversal sequences that cause the files to be written outside of the directory under which the archive is expected to be extracted [REF-1282]. It is most commonly used for relative path traversal (CWE-23) and link following (CWE-59).

Skutki

  • Confidentiality, Integrity, Access Control

    Read Files or Directories; Modify Files or Directories; Bypass Protection Mechanism

    An attacker may be able to traverse the file system to unintended locations and read or overwrite the contents of unexpected files. If the files are used for a security mechanism then an attacker may be able to bypass the mechanism.

  • Other

    Execute Unauthorized Code or Commands

    Windows simple shortcuts, sometimes referred to as soft links, can be exploited remotely since a ".LNK" file can be uploaded like a normal file. This can enable remote execution.

Zapobieganie

  • 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.

Przykłady podatności

Słabość nadrzędna

Słabości podrzędne

Kiedy powstaje

Dotyczy

Not Language-Specific, Windows, Unix, Not Technology-Specific

Uwagi

Link following vulnerabilities are Multi-factor Vulnerabilities (MFV). They are the combination of multiple elements: file or directory permissions, filename predictability, race conditions, and in some cases, a design limitation in which there is no mechanism for performing atomic file creation operations.

Some potential factors are race conditions, permissions, and predictability.

Źródła

  1. The Art of Software Security Assessment — Mark Dowd, John McDonald, Justin Schuh, Chapter 9, "Symbolic Link Attacks", Page 518, Addison Wesley, 2006
  2. Zip Slip Vulnerability — Snyk, 2018
  3. State-of-the-Art Resources (SOAR) for Software Vulnerability Detection, Test, and Evaluation — Gregory Larsen, E. Kenneth Hong Fong, David A. Wheeler, Rama S. Moorthy, 2014

Wpis z katalogu CWE 4.20.