Variant · Low-Medium

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

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 sys...

CWE-54 · Variant Level ·2 CVEs ·1 Mitigations

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.

Potential Impact

Confidentiality, Integrity

Read Files or Directories, Modify Files or Directories

Mitigations & Prevention

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.

Real-World CVE Examples

CVE IDDescription
CVE-2004-0847web 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-0061Bypass directory access restrictions using trailing dot in URL

Taxonomy Mappings

  • PLOVER: — filedir\ (trailing backslash)
  • Software Fault Patterns: SFP16 — Path Traversal

Frequently Asked Questions

What is CWE-54?

CWE-54 (Path Equivalence: 'filedir\' (Trailing Backslash)) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Variant-level weakness. 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 sys...

How can CWE-54 be exploited?

Attackers can exploit CWE-54 (Path Equivalence: 'filedir\' (Trailing Backslash)) to read files or directories, modify files or directories. This weakness is typically introduced during the Implementation, Porting phase of software development.

How do I prevent CWE-54?

Key mitigations include: 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 (C

What is the severity of CWE-54?

CWE-54 is classified as a Variant-level weakness (Low-Medium abstraction). It has been observed in 2 real-world CVEs.