---
title: "CWE-57: Path Equivalence: 'fakedir/../realdir/filename'"
url: https://radicalnotion.ai/cwe/cwe-57
type: cwe
description: "The product contains protection mechanisms to restrict access to 'realdir/filename', but it constructs pathnames using external input in the form of 'fakedir/../realdir/filename' that are not handled by those mechanisms. This allows attackers to perform unauthorized actions against the targeted file."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-57: Path Equivalence: 'fakedir/../realdir/filename'

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 1
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product contains protection mechanisms to restrict access to 'realdir/filename', but it constructs pathnames using external input in the form of 'fakedir/../realdir/filename' that are not handled by those mechanisms. This allows attackers to perform unauthorized actions against the targeted file.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity | Read Files or Directories, Modify Files or Directories | - |

## Potential mitigations

### Implementation (Input Validation)

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 | Description |
| --- | --- |
| CVE-2001-1152 | Proxy allows remote attackers to bypass denylist restrictions and connect to unauthorized web servers by modifying the requested URL, including (1) a // (double slash), (2) a /SUBDIR/.. where the desired file is in the parentdir, (3) a /./, or (4) URL-encoded characters. |
| CVE-2000-0191 | application check access for restricted URL before canonicalization |
| CVE-2005-1366 | CGI source disclosure using "dirname/../cgi-bin" |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-34995 | - | medium | 4.3 | - | No | 2024-05-24 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-41](https://radicalnotion.ai/cwe/cwe-41) | Improper Resolution of Path Equivalence |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | dirname/fakechild/../realchild/filename | - | - |
| Software Fault Patterns | Path Traversal | SFP16 | - |

## Frequently asked questions

### What is CWE-57?

The product contains protection mechanisms to restrict access to 'realdir/filename', but it constructs pathnames using external input in the form of 'fakedir/../realdir/filename' that are not handled by those mechanisms. This allows attackers to perform unauthorized actions against the targeted file.

### What CVEs are caused by CWE-57?

1 recorded CVE is attributed to CWE-57: CVE-2024-34995.

### How do you prevent CWE-57?

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.

### What are the consequences of CWE-57?

Exploiting CWE-57 can lead to: Read Files or Directories, Modify Files or Directories.

### Is CWE-57 actively exploited?

1 recorded CVE is caused by CWE-57; it is not currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/57.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-57). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
