CWE - 22 : Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CWE Definition
|
http://cwe.mitre.org/data/definitions/22.html
|
Number of vulnerabilities:
|
5138
|
Description
|
The software 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 software does not properly sanitize special
elements that can resolve to a location that is outside of the restricted
directory.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", which may also be useful in
accessing unexpected files. This is referred to as absolute path
traversal. |
Background Details
|
|
Other Notes
|
Incomplete diagnosis or reporting of vulnerabilities can make it difficult
to know which variant is affected. For example, a researcher might say that
"..\" is vulnerable, but not test "../" which may also be vulnerable. |
|
|
Warning! CWE definitions are provided as a quick reference. They are
not complete and may not be up to date!
You must visit
http://cwe.mitre.org/ for a complete list of CWE entries
and for more details.