344 vulnerabilities classified as CWE-23 (相对路径遍历). AI Chinese analysis included.
CWE-23, Relative Path Traversal, is a critical input validation weakness where applications fail to properly sanitize user-supplied data before constructing file system paths. Attackers typically exploit this vulnerability by injecting directory traversal sequences, such as “../”, into input fields to manipulate the resulting pathname. This manipulation allows them to escape the intended restricted directory and access sensitive files located elsewhere on the server, potentially leading to unauthorized data disclosure or remote code execution. To mitigate this risk, developers must rigorously validate and neutralize all external inputs, ensuring they do not contain relative path components. Implementing strict allowlists for permitted characters, using canonicalization functions to resolve paths before access checks, and employing chroot jails or containerization to isolate file system access are essential defensive strategies that effectively prevent attackers from traversing outside the designated directory boundaries.
http://example.com/get-files.jsp?file=report.pdf http://example.com/get-page.php?home=aaa.html http://example.com/some-page.asp?page=index.htmlhttp://example.com/get-files?file=../../../../somedir/somefile http://example.com/../../../../etc/shadow http://example.com/get-files?file=../../../../etc/passwdmy $dataPath = "/users/cwe/profiles"; my $username = param("user"); my $profilePath = $dataPath . "/" . $username; open(my $fh, "<", $profilePath) || ExitError("profile read error: $profilePath"); print "<ul>\n"; while (<$fh>) { print "<li>$_</li>\n"; } print "</ul>\n";../../../etc/passwdVulnerabilities classified as CWE-23 (相对路径遍历) represent 344 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.