CWEweakness

CWE-23 Relative Path Traversal

Official page ↗
Alternate terms
Zip Slip
Abstraction
Base
Structure
Simple
Status
Draft
Languages
Not Language-Specific
CWE version
5.0

Description

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.

Common consequences

• Integrity, Confidentiality, Availability: Execute Unauthorized Code or Commands — The attacker may be able to create or overwrite critical files that are used to execute code, such as programs or libraries. • Integrity: Modify Files or Directories — The attacker may be able to overwrite or create critical files, such as programs, libraries, or important data. If the targeted file is used for a security mechanism, then the attacker may be able to bypass that mechanism. For example, appending a new account at the end of a password file may allow an attacker to bypass authentication. • Confidentiality: Read Files or Directories — The attacker may be able to read the contents of unexpected files and expose sensitive data by traversing the file system to access files or directories that are outside of the restricted directory. If the targeted file is used for a security mechanism, then the attacker may be able to bypass that mechanism. For example, by reading a password file, the attacker could conduct brute force password guessing attacks in order to break into an account on the system. • Availability: DoS: Crash, Exit, or Restart — The attacker may be able to overwrite, delete, or corrupt unexpected critical files such as programs, libraries, or important data. This may prevent the product from working at all and in the case of a protection mechanism such as authentication, it has the potential to lockout every user of the product.

Potential mitigations

• [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434. Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string. • [Implementation] Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked. Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes: • realpath() in C • getCanonicalPath() in Java • GetFullPath() in ASP.NET • realpath() or abs_path() in Perl • realpath() in PHP • [Operation] Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

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-2024-37032: Large language model (LLM) management tool does not validate the format of a digest value (CWE-1287) from a private, untrusted model registry, enabling relative path traversal (CWE-23), a.k.a. Probllama • CVE-2024-0520: Product for managing datasets for AI model training and evaluation allows both relative (CWE-23) and absolute (CWE-36) path traversal to overwrite files via the Content-Disposition header • CVE-2022-45918: Chain: a learning management tool debugger uses external input to locate previous session logs (CWE-73) and does not properly validate the given path (CWE-20), allowing for filesystem path traversal using "../" sequences (CWE-24) • CVE-2019-20916: Python package manager does not correctly restrict the filename specified in a Content-Disposition header, allowing arbitrary file read using path traversal sequences such as "../" • CVE-2022-24877: directory traversal in Go-based Kubernetes operator app allows accessing data from the controller's pod file system via ../ sequences in a yaml file • CVE-2020-4053: a Kubernetes package manager written in Go allows malicious plugins to inject path traversal sequences into a plugin archive ("Zip slip") to copy a file outside the intended directory • CVE-2021-21972: Chain: Cloud computing virtualization platform does not require authentication for upload of a tar format file (CWE-306), then uses .. path traversal sequences (CWE-23) in the file to access unexpected files, as exploited in the wild per CISA KEV. • CVE-2019-10743: Go-based archive library allows extraction of files to locations outside of the target folder with "../" path traversal sequences in filenames in a zip file, aka "Zip Slip" • CVE-2002-0298: Server allows remote attackers to cause a denial of service via certain HTTP GET requests containing a %2e%2e (encoded dot-dot), several "/../" sequences, or several "../" in a URI. • CVE-2002-0661: "\" not in denylist for web server, allowing path traversal attacks when the server is run in Windows and other OSes. • CVE-2002-0946: Arbitrary files may be read files via ..\ (dot dot) sequences in an HTTP request. • CVE-2002-1042: Directory traversal vulnerability in search engine for web server allows remote attackers to read arbitrary files via "..\" sequences in queries. • CVE-2002-1209: Directory traversal vulnerability in FTP server allows remote attackers to read arbitrary files via "..\" sequences in a GET request. • CVE-2002-1178: Directory traversal vulnerability in servlet allows remote attackers to execute arbitrary commands via "..\" sequences in an HTTP request. • CVE-2002-1987: Protection mechanism checks for "/.." but doesn't account for Windows-specific "\.." allowing read of arbitrary files. • CVE-2005-2142: Directory traversal vulnerability in FTP server allows remote authenticated attackers to list arbitrary directories via a "\.." sequence in an LS command. • CVE-2002-0160: The administration function in Access Control Server allows remote attackers to read HTML, Java class, and image files outside the web root via a "..\.." sequence in the URL to port 2002. • CVE-2001-0467: "\..." in web server • CVE-2001-0963: "..." in cd command in FTP server • CVE-2001-1193: "..." in cd command in FTP server • CVE-2001-1131: "..." in cd command in FTP server • CVE-2001-0480: read of arbitrary files and directories using GET or CD with "..." in Windows-based FTP server. • CVE-2002-0288: read files using "." and Unicode-encoded "/" or "\" characters in the URL. • CVE-2003-0313: Directory listing of web server using "..." • CVE-2005-1658: Triple dot • CVE-2000-0240: read files via "/........../" in URL • CVE-2000-0773: read files via "...." in web server • CVE-1999-1082: read files via "......" in web server (doubled triple dot?) • CVE-2004-2121: read files via "......" in web server (doubled triple dot?) • CVE-2001-0491: multiple attacks using "..", "...", and "...." in different commands • CVE-2001-0615: "..." or "...." in chat server • CVE-2005-2169: Chain: ".../...//" bypasses protection mechanism using regexp's that remove "../" resulting in collapse into an unsafe value "../" (CWE-182) and resultant path traversal. • CVE-2005-0202: ".../....///" bypasses regexp's that remove "./" and "../" • CVE-2004-1670: Mail server allows remote attackers to create arbitrary directories via a ".." or rename arbitrary files via a "....//" in user supplied parameters.

Related

Attack pattern · CAPEC (2)

  • CAPEC-139 Relative Path Traversal attack pattern
  • CAPEC-76 Manipulating Web Input to File System Calls attack pattern

Observed example · CVE (34)

  • CVE-2024-0520 A vulnerability in mlflow/mlflow version 8.2.1 allows for remote code execution due to improper neutralization of special elements used in… vulnerability
  • CVE-2024-37032 Ollama before 0.1.34 does not validate the format of the digest (sha256 with 64 hex digits) when getting the model path, and thus… vulnerability
  • CVE-2022-45918 ILIAS before 7.16 allows External Control of File Name or Path. vulnerability
  • CVE-2022-24877 Flux is an open and extensible continuous delivery solution for Kubernetes. vulnerability
  • CVE-2021-21972 The vSphere Client (HTML5) contains a remote code execution vulnerability in a vCenter Server plugin. vulnerability
  • CVE-2019-20916 The pip package before 19.2 for Python allows Directory Traversal when a URL is given in an install command, because a Content-Disposition… vulnerability
  • CVE-2020-4053 In Helm greater than or equal to 3.0.0 and less than 3.2.4, a path traversal attack is possible when installing Helm plugins from a tar… vulnerability
  • CVE-2019-10743 All versions of archiver allow attacker to perform a Zip Slip attack via the "unarchive" functions. vulnerability
  • CVE-2005-2169 Directory traversal vulnerability in source.php in Quick & Dirty PHPSource Printer 1.1 and earlier allows remote attackers to read… vulnerability
  • CVE-2005-2142 Directory traversal vulnerability in Golden FTP Server 2.60 allows remote authenticated attackers to list arbitrary directories via a "\.."… vulnerability
  • CVE-2005-1658 Directory traversal vulnerability in filemanager.cpp in MyServer 0.8 allows remote attackers to list the parent directory of the web root… vulnerability
  • CVE-2005-0202 Directory traversal vulnerability in the true_path function in private.py for Mailman 2.1.5 and earlier allows remote attackers to read… vulnerability
  • CVE-2004-2121 Multiple directory traversal vulnerabilities in Borland Web Server (BWS) 1.0b3 and earlier allow remote attackers to read and download… vulnerability
  • CVE-2004-1670 Multiple directory traversal vulnerabilities Merak Mail Server 7.4.5 with Icewarp Web Mail 5.2.7, and possibly other versions, allow remote… vulnerability
  • CVE-2003-0313 Directory traversal vulnerability in Snowblind Web Server 1.0 allows remote attackers to list arbitrary directory contents via a ... vulnerability
  • CVE-2002-1987 Directory traversal vulnerability in view_source.jsp in Resin 2.1.2 allows remote attackers to read arbitrary files via a "\.." (backslash… vulnerability
  • CVE-2002-1209 Directory traversal vulnerability in SolarWinds TFTP Server 5.0.55, and possibly earlier, allows remote attackers to read arbitrary files… vulnerability
  • CVE-2002-1178 Directory traversal vulnerability in the CGIServlet for Jetty HTTP server before 4.1.0 allows remote attackers to execute arbitrary… vulnerability
  • CVE-2002-0946 Directory traversal vulnerability in SeaNox Devwex before 1.2002.0601 allows remote attackers to read arbitrary files via ..\ (dot dot)… vulnerability
  • CVE-2002-1042 Directory traversal vulnerability in search engine for iPlanet web server 6.0 SP2 and 4.1 SP9, and Netscape Enterprise Server 3.6, when… vulnerability
  • CVE-2002-0661 Directory traversal vulnerability in Apache 2.0 through 2.0.39 on Windows, OS2, and Netware allows remote attackers to read arbitrary files… vulnerability
  • CVE-2002-0288 Directory traversal vulnerability in Phusion web server 1.0 allows remote attackers to read arbitrary files via a ... vulnerability
  • CVE-2002-0298 ScriptEase MiniWeb Server 0.95 allows remote attackers to cause a denial of service (crash) via certain HTTP GET requests containing (1) a… vulnerability
  • CVE-2002-0160 The administration function in Cisco Secure Access Control Server (ACS) for Windows, 2.6.x and earlier and 3.x through 3.01 (build 40),… vulnerability
  • CVE-2001-1193 Directory traversal vulnerability in EFTP 2.0.8.346 allows local users to read directories via a ... vulnerability
  • CVE-2001-0963 Directory traversal vulnerability in SpoonFTP 1.1 allows local and sometimes remote attackers to access files outside of the FTP root via a… vulnerability
  • CVE-2001-1131 Directory traversal vulnerability in WhitSoft Development SlimFTPd 2.2 allows an attacker to read arbitrary files and directories via a ... vulnerability
  • CVE-2001-0615 Directory traversal vulnerability in Faust Informatics Freestyle Chat server prior to 4.1 SR3 allows a remote attacker to read arbitrary… vulnerability
  • CVE-2001-0467 Directory traversal vulnerability in RobTex Viking Web server before 1.07-381 allows remote attackers to read arbitrary files via a \... vulnerability
  • CVE-2001-0480 Directory traversal vulnerability in Alex's FTP Server 0.7 allows remote attackers to read arbitrary files via a ... vulnerability
Show all 34 ›

Child of · CWE (1)

  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory weakness

Referenced by CAPEC · weakness (2)

  • CAPEC-139 Relative Path Traversal attack pattern
  • CAPEC-76 Manipulating Web Input to File System Calls attack pattern

Referenced by CVE · weakness (540)

  • CVE-2026-68866 PowerProtect Data Domain, Feature Release versions 7.7.1.0 through 8.7, LTS2024 release versions 7.13.1.0 through 7.13.1.70, LTS2025… vulnerability
  • CVE-2026-90727 Dell PowerProtect Data Domain, Feature Release versions 7.7.1.0 through 8.8, LTS2024 release versions 7.13.1.0 through 7.13.1.80, LTS2025… vulnerability
  • CVE-2026-115812 Relative path traversal during model archive extraction in Amazon Web Services Multi Model Server 1.1.11 and earlier might allow remote… vulnerability
  • CVE-2026-114714 Roundcube Webmail before 1.6.20 and 1.7.x before 1.7.5 is affected by a path traversal vulnerability in the squirrelmail_usercopy plugin. vulnerability
  • CVE-2026-114110 Astral uv before 0.11.6 contains a path traversal vulnerability that allows attackers to delete arbitrary files by supplying wheels with… vulnerability
  • CVE-2026-103508 P4 Search (formerly Helix Search) allows an authenticated user holding administrative privileges on the connected P4 Server to supply a… vulnerability
  • CVE-2026-110746 A local privilege escalation vulnerability in TotalAV allows an unprivileged local user to forge the gRPC IPC authentication token, through… vulnerability
  • CVE-2026-111093 In JetBrains Datalore before 2026.2.1 unauthenticated path traversal via the report blob endpoint allowed reading arbitrary files vulnerability
  • CVE-2026-39993 A relative path traversal vulnerability has been reported to affect Download Station. vulnerability
  • CVE-2026-41545 A relative path traversal vulnerability has been reported to affect QuMagie. vulnerability
  • CVE-2026-110690 Cloud Commander (cloudcmd) versions 19.20.2 through 19.21.1 contains a path traversal vulnerability in the GET /api/v1/pack endpoint where… vulnerability
  • CVE-2026-76519 A vulnerability in the Advanced Malware Protection (AMP) feature of Cisco Secure Email Gateway could allow an unauthenticated, remote… vulnerability
  • CVE-2026-69968 Relative path traversal in Windows Libarchive allows an unauthorized attacker to perform tampering over a network. vulnerability
  • CVE-2026-70222 Relative path traversal in Windows Shell allows an authorized attacker to elevate privileges locally. vulnerability
  • CVE-2026-83865 Relative path traversal in Windows Internet (wininet.dll) allows an authorized attacker to perform tampering locally. vulnerability
  • CVE-2026-83873 Relative path traversal in Windows Shell allows an authorized attacker to elevate privileges locally. vulnerability
  • CVE-2026-83923 Relative path traversal in OpenSSH for Windows allows an unauthorized attacker to execute code over a network. vulnerability
  • CVE-2026-101024 Satel Netco Design versions prior to v2.1.7 contains a relative path traversal vulnerability in its data export functionality. vulnerability
  • CVE-2026-103663 Ollama is vulnerable to path traversal in the `/api/pull` endpoint due to insufficient validation of layer digests by the `digestToPath`… vulnerability
  • CVE-2026-105275 Satel Netco Design versions prior to v2.1.7 contains a relative path traversal vulnerability in its data import functionality. vulnerability
  • CVE-2026-76454 A vulnerability in the Cisco Smart Licensing Utility API of Cisco License On-Prem, formerly Cisco Smart Software Manager On-Prem (SSM… vulnerability
  • CVE-2026-90466 Path traversal of 'trusted_jar_paths' in Impala 4.5.2 allows an attacker-controlled JAR to be loaded via a relative path where the prefix… vulnerability
  • CVE-2026-106490 Backstage is an open framework for building developer portals. vulnerability
  • CVE-2026-106552 In sftp in OpenSSH before 10.6, a server can trigger directory traversal (causing files to be written to unintended locations) during a… vulnerability
  • CVE-2026-103278 Ghost versions 5.8.0 before 6.34.0 contain an input validation vulnerability in the admin iframe that allows attackers to take over staff… vulnerability
  • CVE-2026-10739 Cato Networks SDP Client for Windows before 6.12.6 allows a local user to delete arbitrary files with SYSTEM privileges via improper… vulnerability
  • CVE-2026-13224 A path traversal vulnerability in the Fireware OS WebUI management agent allows an authenticated administrator to read or list arbitrary… vulnerability
  • CVE-2026-102252 A path traversal vulnerability (CWE-22) in the embedded VMDK filesystem extractor in Google OSV-SCALIBR versions 0.3.6 through 0.5.0 allows… vulnerability
  • CVE-2026-8066 A directory traversal vulnerability in the file upload functionality of Hitachi Energy RTU500 end-of-life versions allows an… vulnerability
  • CVE-2026-93537 A user who can supply bundle content to a repository referenced by a GitRepo resource, for example through Git push access, or through… vulnerability
Show all 540 ›

Referenced by CWE · child of (12)

  • CWE-24 Path Traversal: '../filedir' weakness
  • CWE-25 Path Traversal: '/../filedir' weakness
  • CWE-26 Path Traversal: '/dir/../filename' weakness
  • CWE-27 Path Traversal: 'dir/../../filename' weakness
  • CWE-28 Path Traversal: '..\filedir' weakness
  • CWE-29 Path Traversal: '\..\filename' weakness
  • CWE-30 Path Traversal: '\dir\..\filename' weakness
  • CWE-31 Path Traversal: 'dir\..\..\filename' weakness
  • CWE-32 Path Traversal: '...' (Triple Dot) weakness
  • CWE-33 Path Traversal: '....' (Multiple Dot) weakness
  • CWE-34 Path Traversal: '....//' weakness
  • CWE-35 Path Traversal: '.../...//' weakness

Referenced by CWE · has member (1)

Referenced by OWASP · mapped cwe (2)

  • A01:2025 Broken Access Control Top 10 2025
  • A01:2021 Broken Access Control Top 10 2021