CWEweakness
CWE-56 Path Equivalence: 'filedir*' (Wildcard)
- Abstraction
- Variant
- Structure
- Simple
- Status
- Incomplete
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product accepts path input in the form of asterisk wildcard ('filedir*') without appropriate validation, which can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.
Common consequences
• Confidentiality, Integrity: Read Files or Directories, Modify Files or Directories
Potential mitigations
• [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.
Observed examples
• CVE-2004-0696: List directories using desired path and "*"
• CVE-2002-0433: List files in web server using "*.ext"
Related
Observed example · CVE (2)
- CVE-2004-0696 The ShellExample.cgi script in 4D WebSTAR 5.3.2 and earlier allows remote attackers to list arbitrary directories via a URL with the… vulnerability
- CVE-2002-0433 Pi3Web 2.0.0 allows remote attackers to view restricted files via an HTTP request containing a "*" (wildcard or asterisk) character. vulnerability