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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-25 (路径遍历:’/../filedir’) — Vulnerability Class 11

11 vulnerabilities classified as CWE-25 (路径遍历:’/../filedir’). AI Chinese analysis included.

CWE-25 represents a critical input validation weakness where applications fail to properly sanitize external inputs before constructing file paths. Attackers typically exploit this vulnerability by injecting directory traversal sequences, such as “../”, into user-supplied parameters. These sequences allow the application to resolve paths outside the intended restricted directory, enabling unauthorized access to sensitive system files, configuration data, or other restricted resources. To mitigate this risk, developers must implement robust input validation strategies, strictly filtering or rejecting any path traversal characters before processing. Additionally, using canonicalization techniques to normalize paths and verifying that the resolved location remains within the designated secure boundary are essential defensive measures. Employing allow-lists for permitted file extensions and utilizing secure API functions that abstract direct file system access further reduces the attack surface, ensuring that user input cannot manipulate the underlying file structure.

MITRE CWE 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. This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory. Sometimes a program checks for "../" at the beginning of the input, so a "/../" can bypass that check.
Common Consequences (1)
Confidentiality, IntegrityRead Files or Directories, Modify Files or Directories
Mitigations (2)
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…
ImplementationInputs 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.

Vulnerabilities classified as CWE-25 (路径遍历:’/../filedir’) represent 11 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.