Collapse of Data Into Unsafe Value |
Weakness ID: 182 (Weakness Base) | Status: Draft |
Description Summary
Reference | Description |
---|---|
CVE-2004-0815 | "/.////" in pathname collapses to absolute path. |
CVE-2005-3123 | "/.//..//////././" is collapsed into "/.././" after ".." and "//" sequences are removed. |
CVE-2002-0325 | ".../...//" collapsed to "..." due to removal of "./" in web server. |
CVE-2002-0784 | chain: HTTP server protects against ".." but allows "." variants such as "////./../.../". If the server removes "/.." sequences, the result would collapse into an unsafe value "////../" (CWE-182). |
CVE-2005-2169 | MFV. Regular expression intended to protect against directory traversal reduces ".../...//" to "../". |
Avoid making decisions based on names of resources (e.g. files) if those resources can have alternate names. |
Phase: Architecture and Design Assume all input is malicious. Use a standard input validation mechanism to validate all input for length, type, syntax, and business rules before accepting the data to be displayed or stored. Use an "accept known good" validation strategy. |
Use and specify a strong output encoding (such as ISO 8859-1 or UTF 8). |
Do not rely exclusively on blacklist validation to detect malicious input or to encode output. There are too many variants to encode a character; you're likely to miss some variants. |
Inputs should be decoded and canonicalized to the application's current internal representation before being validated. Make sure that your application does not decode the same input twice. Such errors could be used to bypass whitelist schemes by introducing dangerous inputs after they have been checked. |
Canonicalize the name to match that of the file system's representation of the name. This can sometimes be achieved with an available API (e.g. in Win32 the GetFullPathName function). |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 171 | Cleansing, Canonicalization, and Comparison Errors | Development Concepts (primary)699 |
ChildOf | ![]() | 693 | Protection Mechanism Failure | Research Concepts (primary)1000 |
ChildOf | ![]() | 722 | OWASP Top Ten 2004 Category A1 - Unvalidated Input | Weaknesses in OWASP Top Ten (2004) (primary)711 |
CanPrecede | ![]() | 33 | Path Traversal: '....' (Multiple Dot) | Research Concepts1000 |
CanPrecede | ![]() | 34 | Path Traversal: '....//' | Research Concepts1000 |
CanPrecede | ![]() | 35 | Path Traversal: '.../...//' | Research Concepts1000 |
CanFollow | ![]() | 185 | Incorrect Regular Expression | Research Concepts1000 |
Overlaps regular expressions, although an implementation might not necessarily use regexp's. |
Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
---|---|---|---|
PLOVER | Collapse of Data into Unsafe Value |
Submissions | ||||
---|---|---|---|---|
Submission Date | Submitter | Organization | Source | |
PLOVER | Externally Mined | |||
Modifications | ||||
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Eric Dalci | Cigital | External | |
updated Potential Mitigations, Time of Introduction | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Description, Relationships, Relationship Notes, Relevant Properties, Taxonomy Mappings | ||||
2008-11-24 | CWE Content Team | MITRE | Internal | |
updated Observed Examples | ||||
2009-03-10 | CWE Content Team | MITRE | Internal | |
updated Relationships | ||||
2009-07-27 | CWE Content Team | MITRE | Internal | |
updated Potential Mitigations |