CWEweakness

CWE-27 Path Traversal: 'dir/../../filename'

Official page ↗
Abstraction
Variant
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 multiple internal "../" sequences that can resolve to a location that is outside of that directory.

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

Related

Observed example · CVE (1)

  • 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

Child of · CWE (1)

  • CWE-23 Relative Path Traversal weakness

Referenced by CVE · weakness (30)

  • CVE-2026-17495 moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. vulnerability
  • CVE-2026-76344 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-62391 The security fix for CVE-2025-66518 is incomplete. vulnerability
  • CVE-2026-24457 An unsafe parsing of OpenMQ's configuration in OpenMQ versions <6.5.2 and <6.9.0, allows a remote attacker to read arbitrary files from a… vulnerability
  • CVE-2026-20018 A vulnerability in the sftunnel functionality of Cisco Secure Firewall Management Center (FMC) Software and Cisco Secure Firewall Threat… vulnerability
  • CVE-2025-66518 Any client who can access to Apache Kyuubi Server via Kyuubi frontend protocols can bypass server-side config… vulnerability
  • CVE-2025-58292 Denial of service (DoS) vulnerability in the office service. vulnerability
  • CVE-2025-10438 Path Traversal: 'dir/../../filename' vulnerability in Yordam Information Technology Consulting Education and Electrical Systems Industry… vulnerability
  • CVE-2025-58761 Tautulli is a Python based monitoring and tracking tool for Plex Media Server. vulnerability
  • CVE-2025-52237 An issue in the component /stl/actions/download?filePath of SSCMS v7.3.1 allows attackers to execute a directory traversal. vulnerability
  • CVE-2024-43658 Patch traversal, External Control of File Name or Path vulnerability in Iocharger Home allows deletion of arbitrary files This issue… vulnerability
  • CVE-2023-20090 A vulnerability in Cisco TelePresence CE and RoomOS could allow an authenticated, local attacker to elevate privileges to root on an… vulnerability
  • CVE-2024-51747 Kanboard is project management software that focuses on the Kanban methodology. vulnerability
  • CVE-2024-7458 A vulnerability was found in elunez eladmin up to 2.7 and classified as critical. vulnerability
  • CVE-2024-24809 Traccar is an open source GPS tracking system. vulnerability
  • CVE-2024-20348 A vulnerability in the Out-of-Band (OOB) Plug and Play (PnP) feature of Cisco Nexus Dashboard Fabric Controller (NDFC) could allow an… vulnerability
  • CVE-2024-27764 An issue in Jeewms v.3.7 and before allows a remote attacker to escalate privileges via the AuthInterceptor component. vulnerability
  • CVE-2024-25828 cmseasy V7.7.7.9 has an arbitrary file deletion vulnerability in lib/admin/template_admin.php. vulnerability
  • CVE-2024-21896 The permission model protects itself against path traversal attacks by calling path.resolve() on any paths given by the user. vulnerability
  • CVE-2023-52076 Atril Document Viewer is the default document reader of the MATE desktop environment for Linux. vulnerability
  • CVE-2024-23897 Jenkins 2.441 and earlier, LTS 2.426.2 and earlier does not disable a feature of its CLI command parser that replaces an '@' character… vulnerability
  • CVE-2023-50254 Deepin Linux's default document reader `deepin-reader` software suffers from a serious vulnerability in versions prior to 6.0.7 due to a… vulnerability
  • CVE-2023-34125 Path Traversal vulnerability in GMS and Analytics allows an authenticated attacker to read arbitrary files from the underlying filesystem… vulnerability
  • CVE-2023-20127 Multiple vulnerabilities in the web-based management interface of Cisco Prime Infrastructure and Cisco Evolved Programmable Network Manager… vulnerability
  • CVE-2023-20129 Multiple vulnerabilities in the web-based management interface of Cisco Prime Infrastructure and Cisco Evolved Programmable Network Manager… vulnerability
  • CVE-2023-20130 Multiple vulnerabilities in the web-based management interface of Cisco Prime Infrastructure and Cisco Evolved Programmable Network Manager… vulnerability
  • CVE-2023-20131 Multiple vulnerabilities in the web-based management interface of Cisco Prime Infrastructure and Cisco Evolved Programmable Network Manager… vulnerability
  • CVE-2023-27588 Hasura is an open-source product that provides users GraphQL or REST APIs. vulnerability
  • CVE-2022-24785 Moment.js is a JavaScript date library for parsing, validating, manipulating, and formatting dates. vulnerability
  • CVE-2021-35027 A directory traversal vulnerability in the web server of the Zyxel VPN2S firmware version 1.12 could allow a remote attacker to gain access… vulnerability