Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-73 (文件名或路径的外部可控制) — Vulnerability Class 315

315 vulnerabilities classified as CWE-73 (文件名或路径的外部可控制). AI Chinese analysis included.

CWE-73 represents a critical input validation weakness where applications allow external actors to dictate file system paths, potentially leading to unauthorized access or modification of sensitive data. Attackers typically exploit this vulnerability through path traversal techniques, injecting sequences like “../” to escape intended directories and reach critical system files or application configurations. This manipulation occurs when software fails to sanitize user-supplied input before using it in filesystem operations, allowing the attacker to bypass intended access controls. To mitigate this risk, developers must implement rigorous input validation, ensuring that all file paths are strictly checked against a whitelist of allowed directories. Additionally, using canonicalization functions to resolve paths before comparison and employing chroot jails can effectively isolate file access, thereby preventing attackers from navigating outside the designated application sandbox.

MITRE CWE Description
The product allows user input to control or influence paths or file names that are used in filesystem operations. This could allow an attacker to access or modify system files or other files that are critical to the application. Path manipulation errors occur when the following two conditions are met: 1. An attacker can specify a path used in an operation on the filesystem. 2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted. For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker.
Common Consequences (3)
Integrity, ConfidentialityRead Files or Directories, Modify Files or Directories
The application can operate on unexpected files. Confidentiality is violated when the targeted filename is not directly readable by the attacker.
Integrity, Confidentiality, AvailabilityModify Files or Directories, Execute Unauthorized Code or Commands
The application can operate on unexpected files. This may violate integrity if the filename is written to, or if the filename is for a program or other form of executable code.
AvailabilityDoS: Crash, Exit, or Restart, DoS: Resource Consumption (Other)
The application can operate on unexpected files. Availability can be violated if the attacker specifies an unexpected file that the application modifies. Availability can also be affected if the attacker specifies a filename for a large file, or points to a special device or a file that does not hav…
Mitigations (5)
Architecture and DesignWhen the set of filenames is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames, 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 provide this capability.
Architecture and Design, OperationRun your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict all access to files within a particular directory. Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection. This may not be a feasible solution, and it only limits the impact to the oper…
Architecture and DesignFor 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.
ImplementationAssume 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…
Effectiveness: High
ImplementationUse 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).
Examples (2)
The following code uses input from an HTTP request to create a file name. The programmer has not considered the possibility that an attacker could provide a file name such as "../../tomcat/conf/server.xml", which causes the application to delete one of its own configuration files (CWE-22).
String rName = request.getParameter("reportName"); File rFile = new File("/usr/local/apfr/reports/" + rName); ... rFile.delete();
Bad · Java
The following code uses input from a configuration file to determine which file to open and echo back to the user. If the program runs with privileges and malicious users can change the configuration file, they can use the program to read any file on the system that ends with the extension .txt.
fis = new FileInputStream(cfg.getProperty("sub")+".txt"); amt = fis.read(arr); out.println(arr);
Bad · Java
CVE IDTitleCVSSSeverityPublished
CVE-2022-43513 Siemens Automation License Manager 安全漏洞 — Automation License Manager V5 8.2 High2023-01-10
CVE-2014-125059 sternenseemann sternenblog main.c blog_index file inclusion — sternenblog 5.0 Medium2023-01-07
CVE-2014-125044 soshtolsus wing-tight index.php file inclusion — wing-tight 6.3 Medium2023-01-05
CVE-2022-34669 NVIDIA GPU Display Driver 安全漏洞 — vGPU software (guest driver) - Windows, NVIDIA Cloud Gaming (guest driver) 8.8 High2022-12-30
CVE-2022-23536 Alertmanager can expose local files content via specially crafted config — cortex 6.5 Medium2022-12-19
CVE-2022-42732 Siemens syngo Dynamics 安全漏洞 — syngo Dynamics 7.5 -2022-11-17
CVE-2022-42733 Siemens syngo Dynamics 安全漏洞 — syngo Dynamics 7.5 -2022-11-17
CVE-2022-42734 Siemens syngo Dynamics 安全漏洞 — syngo Dynamics 7.5 -2022-11-17
CVE-2022-42891 Siemens syngo Dynamics 安全漏洞 — syngo Dynamics 7.5 -2022-11-17
CVE-2022-42893 Siemens syngo Dynamics 安全漏洞 — syngo Dynamics 7.5 -2022-11-17
CVE-2022-2431 Download Manager <= 3.2.50 - Authenticated (Contributor+) Arbitrary File Deletion — Download Manager 8.1 High2022-09-06
CVE-2022-2638 Export All URLs < 4.4 - Admin+ Arbitrary System File Removal — Export All URLs 6.5 -2022-08-29
CVE-2022-32761 WWBN AVideo 安全漏洞 — AVideo 6.5 -2022-08-22
CVE-2022-28710 WWBN AVideo 安全漏洞 — AVideo 6.5 -2022-08-22
CVE-2022-2400 External Control of File Name or Path in dompdf/dompdf — dompdf/dompdf 8.2 -2022-07-18
CVE-2022-34765 多款Schneider Electric产品安全漏洞 — OPC UA Modicon Communication Module 5.5 Medium2022-07-13
CVE-2022-24900 Absolute Path Traversal due to incorrect use of `send_file` call in Piano LED Visualizer — Piano-LED-Visualizer 9.9 Critical2022-04-29
CVE-2022-20789 Cisco Unified Communications Products Arbitrary File Write Vulnerability — Cisco Unified Communications Manager 4.9 Medium2022-04-21
CVE-2022-0246 iQ Block Country < 1.2.13 - Admin+ Arbitrary File Deletion via Zip Slip — iQ Block Country 6.5 -2022-04-11
CVE-2022-0593 Login with phone number < 1.3.7 - Unauthenticated remote plugin deletion — Login with phone number 8.2 -2022-03-14
CVE-2021-24966 Error Log Viewer Plugin <= 1.1.1 - Admin+ Arbitrary File Clearing — Error Log Viewer by BestWebSoft 4.9 -2022-03-14
CVE-2021-3845 External Control of File Name or Path in netristv/ws-scrcpy — netristv/ws-scrcpy 7.5 -2022-01-04
CVE-2021-34761 Cisco Firepower Threat Defense Software CLI Arbitrary File Write Vulnerability — Cisco Firepower Threat Defense Software 4.4 Medium2021-10-27
CVE-2021-38477 AUVESY Versiondog — Versiondog 9.8 Critical2021-10-22
CVE-2021-3626 Windows version of Multipass unauthenticated localhost tcp control socket can perform mounts — Multipass 8.8 High2021-10-01
CVE-2021-1306 Cisco ADE-OS Local File Inclusion Vulnerability — Cisco Identity Services Engine Software 4.4 Medium2021-05-22
CVE-2021-22539 Code execution in VSCode-bazel via malicious Bazel config files — VSCode-Bazel 8.2 High2021-04-16
CVE-2021-27250 D-Link DAP-2020 安全漏洞 — DAP-2020 6.5 -2021-04-14
CVE-2021-21343 XStream is vulnerable to an Arbitrary File Deletion on the local host when unmarshalling as long as the executing process has sufficient rights — xstream 5.3 Medium2021-03-22
CVE-2020-25161 Advantech WebAccess/SCADA WADashboard 安全漏洞 — Advantech WebAccess/SCADA 9.8 -2021-02-23

Vulnerabilities classified as CWE-73 (文件名或路径的外部可控制) represent 315 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.