CWEweakness

CWE-54 Path Equivalence: 'filedir\' (Trailing Backslash)

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Incomplete
Languages
Not Language-Specific
CWE version
5.0

Description

The product accepts path input in the form of trailing backslash ('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-0847: web framework for .NET allows remote attackers to bypass authentication for .aspx files in restricted directories via a request containing a (1) "\" (backslash) or (2) "%5C" (encoded backslash) • CVE-2004-0061: Bypass directory access restrictions using trailing dot in URL

Related

Observed example · CVE (2)

  • CVE-2004-0847 The Microsoft .NET forms authentication capability for ASP.NET allows remote attackers to bypass authentication for .aspx files in… vulnerability
  • CVE-2004-0061 WWW File Share Pro 2.42 and earlier allows remote attackers to bypass directory access restrictions via (1) a URL with a trailing . vulnerability

Child of · CWE (2)

  • CWE-162 Improper Neutralization of Trailing Special Elements weakness
  • CWE-41 Improper Resolution of Path Equivalence weakness