CWEweakness

CWE-24 Path Traversal: '../filedir'

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Incomplete
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 that can resolve to a location that is outside of that directory.

Extended description

The "../" manipulation is the canonical manipulation for operating systems that use "/" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which "/" is supported but not the primary separator, such as Windows, which uses "\" but can also accept "/".

Common consequences

• Confidentiality, Integrity: Read Files or Directories, Modify Files or Directories — An attacker can traverse the file system to access files or directories that are outside of the restricted directory.

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.

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-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)

Related

Observed example · CVE (1)

  • CVE-2022-45918 ILIAS before 7.16 allows External Control of File Name or Path. vulnerability

Child of · CWE (1)

  • CWE-23 Relative Path Traversal weakness

Referenced by CVE · weakness (127)

  • CVE-2026-118485 Axel Download Accelerator 2.17.14 and earlier performs URL percent-decoding (http_decode()) on the output filename after the URL has been… vulnerability
  • CVE-2026-90721 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-108980 Blinko through 1.8.8 allows directory traversal, overwriting startup files as root, via installPlugin. vulnerability
  • CVE-2026-92533 Path traversal vulnerability in the BugTracker.NET file download component. vulnerability
  • CVE-2026-105314 Papermerge 3.5.3 allows remote code execution by a standard user via directory traversal in a /api/documents/upload call. vulnerability
  • CVE-2026-104994 Trivy before 0.71.0 allows directory traversal in Terraform filesystem functions when they try to access pathnames above the scan root. vulnerability
  • CVE-2026-103088 Handlebars.java before 4.5.5 allows directory traversal. vulnerability
  • CVE-2026-97730 In Netgate pfSense Plus before 26.07 and pfSense CE before 2.9.0, a Local File Inclusion (LFI) vulnerability in the Dashboard (index.php)… vulnerability
  • CVE-2026-34151 XWiki Platform is a generic wiki platform. vulnerability
  • CVE-2025-70819 Zettlab D6 Ultra before 1.7.0 allows mounting /etc/passwd and /etc/shadow in a container via ".." manipulations such as volumes: -… vulnerability
  • CVE-2026-14947 A high-privileged remote attacker can upload malicious ZIP archive containing directory traversal sequences such as ../ can escape the… vulnerability
  • CVE-2026-76353 In Splunk Enterprise versions below 10.4.2, 10.2.6, 10.0.9, and 9.4.14, a user who does not hold the "admin" or "power" Splunk roles could… vulnerability
  • CVE-2026-73573 In Zimbra Collaboration (ZCS) before 10.1.17, a path traversal vulnerability exists in the Zimbra Briefcase document editing functionality… vulnerability
  • CVE-2026-48047 XWiki Platform WebJars API is a package for XWiki, a generic wiki platform. vulnerability
  • CVE-2026-66140 Exim before 4.99.5 allows directory traversal to access files outside of the spool area, and consequently gain privileges, because… vulnerability
  • CVE-2026-46687 Emlog is an open source website building system. vulnerability
  • CVE-2026-44942 A path traversal in handling the "path" component of .repo files processed by libzypp before 17.38.13 in the 17.x series, or before… vulnerability
  • CVE-2026-49103 Webmin before 2.640 does not safely construct a filename for saving of an attachment within the mailboxes component. vulnerability
  • CVE-2026-22810 Joplin is an open source note-taking and to-do application that organises notes and lists into notebooks. vulnerability
  • CVE-2026-33431 Roxy-WI is a web interface for managing Haproxy, Nginx, Apache and Keepalived servers. vulnerability
  • CVE-2026-40318 SiYuan is an open-source personal knowledge management system. vulnerability
  • CVE-2026-41082 In OCaml opam before 2.5.1, a .install field containing a destination filepath can use ../ to reach a parent directory. vulnerability
  • CVE-2026-39813 A path traversal: '../filedir' vulnerability in Fortinet FortiSandbox 5.0.0 through 5.0.5, FortiSandbox 4.4.0 through 4.4.8 may allow… vulnerability
  • CVE-2024-43035 Fonoster 0.5.5 before 0.6.1 allows ../ directory traversal to read arbitrary files via the /sounds/:file or /tts/:file VoiceServer endpoint. vulnerability
  • CVE-2026-28538 Path traversal vulnerability in the certificate management module. vulnerability
  • CVE-2026-28427 OpenDeck is Linux software for your Elgato Stream Deck. vulnerability
  • CVE-2025-67364 fast-filesystem-mcp version 3.4.0 contains a critical path traversal vulnerability in its file operation tools including fast_read_file. vulnerability
  • CVE-2026-21857 REDAXO is a PHP-based content management system. vulnerability
  • CVE-2026-21436 eopkg is a Solus package manager implemented in python3. vulnerability
  • CVE-2025-67845 A Directory Traversal vulnerability in the Static Asset Proxy Endpoint in Mintlify Platform before 2025-11-15 allows remote attackers to… vulnerability
Show all 127 ›