CWE WEAKNESSES / CWE-36
CWE-36
Absolute Path Traversal
Base
What it is
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as "/abs/path" 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.
Impact
| Integrity, Confidentiality, Availability | Execute Unauthorized Code or Commands |
| Integrity | Modify Files or Directories |
| Confidentiality | Read Files or Directories |
| Availability | DoS: Crash, Exit, or Restart |
Mitigations
- [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 r
- [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.
- [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].
Real-world CVE examples
- CVE-2024-0520 — Product for managing datasets for AI model training and evaluation allows both relative (CWE-23) and absolute (CWE-36) path traversal to overwrite files via the
- CVE-2022-31503 — Python package constructs filenames using an unsafe os.path.join call on untrusted input, allowing absolute path traversal because os.path.join resets the pathn
- CVE-2002-1345 — Multiple FTP clients write arbitrary files via absolute paths in server responses
- CVE-2001-1269 — ZIP file extractor allows full path
- CVE-2002-1818 — Path traversal using absolute pathname
- CVE-2002-1913 — Path traversal using absolute pathname
- CVE-2005-2147 — Path traversal using absolute pathname
- CVE-2000-0614 — Arbitrary files may be overwritten via compressed attachments that specify absolute path names for the decompressed output.
- CVE-1999-1263 — Mail client allows remote attackers to overwrite arbitrary files via an e-mail message containing a uuencoded attachment that specifies the full pathname for th
- CVE-2003-0753 — Remote attackers can read arbitrary files via a full pathname to the target file in config parameter.
- CVE-2002-1525 — Remote attackers can read arbitrary files via an absolute pathname.
- CVE-2001-0038 — Remote attackers can read arbitrary files by specifying the drive letter in the requested URL.
Related weaknesses
Test & detect
Browse all common weaknesses, check related exploited CVEs, or map to ATT&CK techniques.
Source: MITRE CWE. View on cwe.mitre.org →