Skip to content
OpenAdvisories

Weakness (CWE)

CWE-22: Improper Limitation of a Pathname to a Restricted Directory

Base

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

More detail

Many file operations are intended to take place within a restricted directory. By using special elements such as ".." and "/" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the "../" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as "/usr/local/bin" to access unexpected files. This is referred to as absolute path traversal.

How to prevent it (8 mitigations)
  1. 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.

  2. Architecture and Design

    For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

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

  4. Architecture and Design

    Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].

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

  6. Architecture and Design, Operation

    Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.

  7. Architecture and Design

    When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.

    For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.

  8. Architecture and Design, Operation

    Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.

    OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.

    This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.

    Be careful to avoid CWE-243 and other weaknesses related to jails.

Source: MITRE CWE-22

269 results · Clear filters · Feed

  • High 7.8
    CVE-2025-68921 Public exploit

    SteelSeries Nahimic 3 1.10.7 allows Directory traversal.

  • High 8.1
    CVE-2025-68472 Public exploit EPSS 20%

    MindsDB has improper sanitation of filepath that leads to information disclosure and DOS

    MindsDB is a platform for building artificial intelligence from enterprise data. Prior to version 25.11.1, an unauthenticated path traversal in the file upload API lets any caller read arbitrary files from the server filesystem and move them into MindsDB’s st…

  • High 8.8
    CVE-2025-69194 Public exploit

    Wget2: arbitrary file write via metalink path traversal in gnu wget2

    A security issue was discovered in GNU Wget2 when handling Metalink documents. The application fails to properly validate file paths provided in Metalink <file name> elements. An attacker can abuse this behavior to write files to unintended locations on the s…

  • High 8.3
    CVE-2026-21857 Public exploit

    Redaxo has Path Traversal in Backup Addon Leading to Arbitrary File Read

    REDAXO is a PHP-based content management system. Prior to version 5.20.2, authenticated users with backup permissions can read arbitrary files within the webroot via path traversal in the Backup addon's file export functionality. The Backup addon does not val…

  • High 8.8
    CVE-2025-68705 Public exploit

    RustFS Path Traversal Vulnerability

    RustFS is a distributed object storage system built in Rust. In versions 1.0.0-alpha.13 to 1.0.0-alpha.78, RustFS contains a path traversal vulnerability in the /rustfs/rpc/read_file_stream endpoint. This issue has been patched in version 1.0.0-alpha.79.

  • High 7.5
    CVE-2025-67160 Public exploit

    An issue in Vatilon v1.12.37-20240124 allows attackers to access sensitive directories and files via a directory traver…

  • High 8.7
    CVE-2025-8110 Exploited Public exploit Scanner template EPSS 80%

    File overwrite in file update API in Gogs

    Improper Symbolic link handling in the PutContents API in Gogs allows Local Execution of Code.

    KEV Jan 12, 2026
  • High 7.5
    CVE-2025-13339 Public exploit Scanner template

    Hippoo Mobile App for WooCommerce <= 1.7.1 - Unauthenticated Arbitrary File Read

    The Hippoo Mobile App for WooCommerce plugin for WordPress is vulnerable to Path Traversal in all versions up to, and including, 1.7.1 via the template_redirect() function. This makes it possible for unauthenticated attackers to read the contents of arbitrary…

  • High 7.5
    CVE-2025-66645 Public exploit

    NiceGUI Path Traversal Vulnerability in app.add_media_files() Allows Arbitrary File Reading

    NiceGUI is a Python-based UI framework. Versions 3.3.1 and below are vulnerable to directory traversal through the App.add_media_files() function, which allows a remote attacker to read arbitrary files on the server filesystem. This issue is fixed in version …

  • High 7.0
    CVE-2025-11001 Public exploit EPSS 27%

    7-Zip ZIP File Parsing Directory Traversal Remote Code Execution Vulnerability

    7-Zip ZIP File Parsing Directory Traversal Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of 7-Zip. Interaction with this product is required to exploit this vulnerability bu…

  • High 7.5
    CVE-2025-60574 Public exploit

    A Local File Inclusion (LFI) vulnerability has been identified in tQuadra CMS 4.2.1117. The issue exists in the "/style…

  • High 8.6
    CVE-2025-10897 Public exploit Scanner template

    WooCommerce Designer Pro <= 1.9.28 - Unauthenticated Arbitrary File Read

    The WooCommerce Designer Pro theme for WordPress is vulnerable to arbitrary file read in all versions up to, and including, 1.9.28. This makes it possible for unauthenticated attackers to read arbitrary files on the server, which can expose DB credentials whe…

  • High 8.1
    CVE-2025-11201 Public exploit EPSS 28%

    MLflow Tracking Server Model Creation Directory Traversal Remote Code Execution Vulnerability

    MLflow Tracking Server Model Creation Directory Traversal Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of MLflow Tracking Server. Authentication is not required to exploit …

  • High 7.5
    CVE-2025-61884 Exploited · Ransomware Public exploit Scanner template EPSS 96%

    Vulnerability in the Oracle Configurator product of Oracle E-Business Suite (component: Runtime UI). Supported versions…

    KEV Oct 20, 2025
  • High 7.3
    CVE-2025-10951 Public exploit

    geyang ml-logger server.py log_handler path traversal

    A vulnerability was identified in geyang ml-logger up to acf255bade5be6ad88d90735c8367b28cbe3a743. Affected by this vulnerability is the function log_handler of the file ml_logger/server.py. Such manipulation of the argument File leads to path traversal. It i…

  • High 7.1
    CVE-2025-56815 Public exploit

    Datart 1.0.0-rc.3 is vulnerable to Directory Traversal in the POST /viz/image interface, since the server directly uses…

  • High 8.7
    CVE-2010-20109 Public exploit

    Barracuda Spam & Virus Firewall "locale" Path Traversal

    Barracuda products, confirmed in Spam & Virus Firewall, SSL VPN, and Web Application Firewall versions prior to October 2010, contain a path traversal vulnerability in the view_help.cgi endpoint. The locale parameter fails to properly sanitize user input, all…

  • High 8.7
    CVE-2012-10061 Public exploit

    Sockso Music Host Server <= 1.5 Path Traversal

    Sockso Music Host Server versions <= 1.5 are vulnerable to a path traversal flaw that allows unauthenticated remote attackers to read arbitrary files from the server’s filesystem. The vulnerability exists in the HTTP interface on port 4444, where the endpoint…

  • High 8.7
    CVE-2011-10009 Public exploit

    S40 CMS 0.4.2 Path Traversal

    S40 CMS v0.4.2 contains a path traversal vulnerability in its index.php page handler. The p parameter is not properly sanitized, allowing attackers to traverse the file system and access arbitrary files outside the web root. This can be exploited remotely wit…

  • High 7.5
    CVE-2025-25231 Exploited Public exploit Scanner template EPSS 25%

    Omnissa Workspace ONE UEM contains a Secondary Context Path Traversal Vulnerability. A malicious actor may be able to g…

  • High 8.7
    CVE-2012-10048 Public exploit

    Zenoss 3.x showDaemonXMLConfig Command Execution

    Zenoss Core 3.x contains a command injection vulnerability in the showDaemonXMLConfig endpoint. The daemon parameter is passed directly to a Popen() call in ZenossInfo.py without proper sanitation, allowing authenticated users to execute arbitrary commands on…

  • High 7.1
    CVE-2012-10024 Public exploit

    XBMC ≤ 11.0 Web Server Path Traversal

    XBMC version 11.0 contains a path traversal vulnerability in its embedded HTTP server. When accessed via HTTP Basic Authentication, the server fails to properly sanitize URI input, allowing authenticated users to request files outside the intended document ro…

  • High 8.7
    CVE-2012-10034 Public exploit

    ClanSphere 2011.3 Local File Inclusion via cs_lang Cookie

    ClanSphere 2011.3 is vulnerable to a local file inclusion (LFI) flaw due to improper handling of the cs_lang cookie parameter. The application fails to sanitize user-supplied input, allowing attackers to traverse directories and read arbitrary files outside t…

  • High 7.7
    CVE-2025-54794 Public exploit

    Claude Code Research Preview has a Path Restriction Bypass which could allow unauthorized file access

    Claude Code is an agentic coding tool. In versions below 0.2.111, a path validation flaw using prefix matching instead of canonical path comparison, makes it possible to bypass directory restrictions and access files outside the CWD. Successful exploitation d…

  • High 8.5
    CVE-2013-10046 Public exploit

    Agnitum Outpost Internet Security Local Privilege Escalation

    A local privilege escalation vulnerability exists in Agnitum Outpost Internet Security 8.1 that allows an unprivileged user to execute arbitrary code with SYSTEM privileges. The flaw resides in the acs.exe component, which exposes a named pipe that accepts un…

  • High 8.8
    CVE-2014-125125 Public exploit

    A10 Networks AX Loadbalancer Path Traversal

    A path traversal vulnerability exists in A10 Networks AX Loadbalancer versions 2.6.1-GR1-P5, 2.7.0, and earlier. The vulnerability resides in the handling of the filename parameter in the /xml/downloads endpoint, which fails to properly sanitize user input. A…

  • High 7.2
    CVE-2025-46359 Public exploit

    A path traversal issue exists in backup and restore feature of multiple versions of PowerCMS. A product administrator m…

  • High 8.2
    CVE-2025-44137 Public exploit Scanner template

    MapTiler Tileserver-php v2.0 is vulnerable to Directory Traversal. The renderTile function within tileserver.php is res…

  • High 8.7
    CVE-2010-10012 Public exploit

    httpdASM 0.92 Path Traversal

    A path traversal vulnerability exists in httpdasm version 0.92, a lightweight Windows HTTP server, that allows unauthenticated attackers to read arbitrary files on the host system. By sending a specially crafted GET request containing a sequence of URL-encode…

  • High 8.7
    CVE-2018-25113 Public exploit

    Dicoogle PACS Web Server 2.5.0 Unauthenticated Path Traversal

    An unauthenticated path traversal vulnerability exists in Dicoogle PACS Web Server version 2.5.0 and possibly earlier. The vulnerability allows remote attackers to read arbitrary files on the underlying system by sending a crafted request to the /exportFile e…

  • High 7.5
    CVE-2015-10136 Public exploit

    GI-Media Library < 3.0 - Directory Traversal

    The GI-Media Library plugin for WordPress is vulnerable to Directory Traversal in versions before 3.0 via the 'fileid' parameter. This allows unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive informat…

  • High 7.5
    CVE-2015-10134 Public exploit

    Simple Backup <= 2.7.10 - Arbitrary File Download via Path Traversal

    The Simple Backup plugin for WordPress is vulnerable to Arbitrary File Download in versions up to, and including, 2.7.10. via the download_backup_file function. This is due to a lack of capability checks and file type validation. This makes it possible for at…

  • High 7.5
    CVE-2025-27210 Public exploit EPSS 14%

    An incomplete fix has been identified for CVE-2025-23084 in Node.js, specifically affecting Windows device names like C…

  • High 8.7
    CVE-2025-34126 Public exploit

    RIPS Scanner v0.54 Path Traversal

    A path traversal vulnerability exists in RIPS Scanner version 0.54. The vulnerability allows remote attackers to read arbitrary files on the system with the privileges of the web server by sending crafted HTTP GET requests to the 'windows/code.php' script wit…

  • High 8.7
    CVE-2025-34120 Public exploit

    LimeSurvey 2.0+ - 2.06+ Unauthenticated Arbitrary File Download via Serialized Backup Payload

    An unauthenticated file download vulnerability exists in LimeSurvey versions from 2.0+ up to and including 2.06+ Build 151014. The application fails to validate serialized input to the admin backup endpoint (`index.php/admin/update/sa/backup`), allowing attac…

  • High 8.7
    CVE-2025-34118 Public exploit

    Linknat VOS Manager Path Traversal File Disclosure

    A path traversal vulnerability exists in Linknat VOS Manager versions prior to 2.1.9.07, including VOS2009 and early VOS3000 builds, that allows unauthenticated remote attackers to read arbitrary files on the server. The vulnerability is accessible via multip…

  • High 8.8
    CVE-2025-53632 Public exploit

    Chall-Manager's scenario decoding process does not check for zip slips

    Chall-Manager is a platform-agnostic system able to start Challenges on Demand of a player. When decoding a scenario (i.e. a zip archive), the path of the file to write is not checked, potentially leading to zip slips. Exploitation does not require authentica…

  • High 8.2
    CVE-2025-44177 Public exploit Scanner template

    A directory traversal vulnerability was discovered in White Star Software Protop version 4.4.2-2024-11-27, specifically…

  • High 7.8
    CVE-2025-6218 Exploited Public exploit EPSS 90%

    RARLAB WinRAR Directory Traversal Remote Code Execution Vulnerability

    RARLAB WinRAR Directory Traversal Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of RARLAB WinRAR. User interaction is required to exploit this vulnerability in that the targ…

    KEV Dec 9, 2025
  • High 7.8
    CVE-2025-6020 Public exploit

    Linux-pam: linux-pam directory traversal

    A flaw was found in linux-pam. The module pam_namespace may use access user-controlled paths without proper protection, allowing local users to elevate their privileges to root via multiple symlink attacks and race conditions.