CWEweakness

CWE-29 Path Traversal: '\..\filename'

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 '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.

Extended description

Sometimes a program checks for "..\" at the beginning of the input, so a "\..\" can bypass that check. It is also useful for bypassing path traversal protection schemes that only assume that the "/" separator is valid.

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

Related

Observed example · CVE (2)

  • CVE-2005-2142 Directory traversal vulnerability in Golden FTP Server 2.60 allows remote authenticated attackers to list arbitrary directories 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

Child of · CWE (1)

  • CWE-23 Relative Path Traversal weakness

Referenced by CVE · weakness (64)

  • CVE-2026-66152 A Path traversal vulnerability in the SonicWall NetExtender Linux client file extractor component allows an attacker to write arbitrary… vulnerability
  • CVE-2026-10732 All versions of the package decompress are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) when extracting a ZIP… vulnerability
  • CVE-2026-24217 NVIDIA BioNeMo Core for Linux contains a vulnerability where a user could cause a path traversal by loading a malicious file. vulnerability
  • CVE-2026-5627 A path traversal vulnerability exists in mintplex-labs/anything-llm versions up to and including 1.9.1, within the `AgentFlows` component. vulnerability
  • CVE-2025-15036 A path traversal vulnerability exists in the `extract_archive_to_dir` function within the `mlflow/pyfunc/dbconnect_artifact_cache.py` file… vulnerability
  • CVE-2026-30828 Wallos is an open-source, self-hostable personal subscription tracker. vulnerability
  • CVE-2025-66608 A vulnerability has been found in FAST/TOOLS provided by Yokogawa Electric Corporation. vulnerability
  • CVE-2024-2356 A Local File Inclusion (LFI) vulnerability exists in the '/reinstall_extension' endpoint of the parisneo/lollms-webui application,… vulnerability
  • CVE-2025-12790 A flaw was found in Rubygem MQTT. vulnerability
  • CVE-2025-58291 Denial of service (DoS) vulnerability in the office service. vulnerability
  • CVE-2025-50184 DbGate is cross-platform database manager. vulnerability
  • CVE-2025-50185 DbGate is cross-platform database manager. vulnerability
  • CVE-2025-6209 A path traversal vulnerability exists in run-llama/llama_index versions 0.12.27 through 0.12.40, specifically within the `encode_image`… vulnerability
  • CVE-2024-10648 A path traversal vulnerability exists in the Gradio Audio component of gradio-app/gradio, as of version git 98cbcae. vulnerability
  • CVE-2024-11170 A vulnerability in danny-avila/librechat version git 81f2936 allows for path traversal due to improper sanitization of file paths by the… vulnerability
  • CVE-2024-12389 A path traversal vulnerability exists in binary-husky/gpt_academic version git 310122f. vulnerability
  • CVE-2024-7957 An arbitrary file overwrite vulnerability exists in the ZulipConnector of danswer-ai/danswer, affecting the latest version. vulnerability
  • CVE-2024-8248 A vulnerability in the normalizePath function in mintplex-labs/anything-llm version git 296f041 allows for path traversal, leading to… vulnerability
  • CVE-2024-8537 A path traversal vulnerability exists in the modelscope/agentscope application, affecting all versions. vulnerability
  • CVE-2024-8859 A path traversal vulnerability exists in mlflow/mlflow version 2.15.1. vulnerability
  • CVE-2024-8982 A Local File Inclusion (LFI) vulnerability in OpenLLM version 0.6.10 allows attackers to include files from the local server through the… vulnerability
  • CVE-2024-13059 A vulnerability in mintplex-labs/anything-llm prior to version 1.3.1 allows for path traversal due to improper handling of non-ASCII… vulnerability
  • CVE-2024-51534 Dell PowerProtect DD versions prior to DDOS 8.3.0.0, 7.10.1.50, and 7.13.1.20 contain a path traversal vulnerability. vulnerability
  • CVE-2024-21542 Versions of the package luigi before 3.6.0 are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip) due to improper… vulnerability
  • CVE-2024-7774 A path traversal vulnerability exists in the `getFullPath` method of langchain-ai/langchainjs version 0.2.5. vulnerability
  • CVE-2024-7962 An arbitrary file read vulnerability exists in gaizhenbiao/chuanhuchatgpt version 20240628 due to insufficient validation when loading… vulnerability
  • CVE-2024-6394 A Local File Inclusion vulnerability exists in parisneo/lollms-webui versions below v9.8. vulnerability
  • CVE-2024-6396 A vulnerability in the `_backup_run` function in aimhubio/aim version 3.19.3 allows remote attackers to overwrite any file on the host… vulnerability
  • CVE-2024-5926 A path traversal vulnerability in the get-project-files functionality of stitionai/devika allows attackers to read arbitrary files from the… vulnerability
  • CVE-2024-6139 A path traversal vulnerability exists in the XTTS server of the parisneo/lollms package version v9.6. vulnerability
Show all 64 ›