Programming Search⌘K

Weaknesscore

Path traversal

Also called directory traversal, dot-dot-slash, cwe-22.

Path traversal happens when a program builds a file path from outside input and does not check where the path points, so `..` or an absolute path reaches files outside the intended directory.

Abstraction
base
OWASP Top 10 (2025)
A01
CWE Top 25 (2025)
rank 6
Languages affected
any-that-opens-files

Description

Many programs take a file name from outside and join it to a fixed directory: a server that sends files from public, a tool that writes uploads to uploads, a program that extracts an archive. The file system then resolves the joined path one component at a time. A .. component means the parent directory, and a path that starts with /, or with a drive letter on Windows, starts at the root. Path traversal happens when the input holds such components and the program does not check where the result points.1 The program meant a file in one directory. The file system opens a file somewhere else.

The root cause is that the program treats the name as data, but the file system reads it as a path, which has its own syntax. A check on the text does not match the way the file system resolves the path. public/../secret.txt starts with the text public, and it still names a file outside it. The fix is to compute the path that the file system will use and check that path, or to take no path from the input at all.

What the attacker gets depends on the operation. A read can expose configuration files, keys and source code. A write can create or change files, and if the file is a program, a library or a configuration that a program loads, it can lead to code execution.1

CWE-22 names this weakness. It is a base weakness under CWE-706, use of an incorrectly resolved name or reference. Its children are relative path traversal (CWE-23), with .., and absolute path traversal (CWE-36), with a full path.1 CWE-22 prefers the term "path traversal" to "directory traversal".1 OWASP also lists the names "dot-dot-slash", "directory climbing" and "backtracking".6 CWE-22 is rank 6 of the 2025 CWE Top 25, and 10 of its CVEs are in the CISA catalogue of known exploited vulnerabilities.3 In the OWASP Top 10:2025 it is part of A01:2025 Broken Access Control.2

Three ways out

  • .. components. Each .. climbs one directory. The check must see the path after the file system has resolved them.1
  • An absolute name. Many join functions drop the earlier parts when a later part is absolute. Python's os.path.join, .NET's Path.Combine and Rust's PathBuf::push all do this, and Node's path.resolve works from right to left until it has an absolute path.7131412 CWE-22 lists CVE-2022-31503 as an example of this case in Python.1
  • A symbolic link. A link inside the directory can point outside it. A check on the text cannot see it, because the link is in the file system and not in the name. CWE-59 names this weakness.1

Archives

An archive member has a name, and the name is a path. A program that extracts an archive joins each member name to the destination, so a member named ../outside.txt lands outside it. This form is often called Zip Slip.20 CVE-2007-4559 describes it in the tarfile module of Python.19 The Python documentation describes extraction filters for tarfile, and the data filter refuses members that would land outside the destination. The documentation still says never to extract archives from untrusted sources without prior inspection.9

History

CERT/CC made the "Web Server Folder Directory Traversal" vulnerability in Microsoft IIS 4 and 5 public on 10 October 2000, as vulnerability note VU#111677.4 By design, IIS refused a relative reference such as /data/../../../winnt/file.dat. When a reference was encoded with certain unicode characters, IIS failed to prevent the access. In the executable scripts directory, this let a visitor run programs with the rights of the IUSR_machinename account.4 The note said that the vulnerability was like others that had been widely exploited, and that systems with it were likely to be compromised.4 CVE-2000-0884 is the record for it.5 The lesson is that the check must see the path in the same form as the code that opens the file. CWE-22 says to decode and canonicalize input before validation.1

Vulnerable code

The function below joins a name to the public directory and opens the result. The second call uses the classic demonstration input ../secret.txt. The third passes an absolute path.

This code runs but gives a wrong answer on purpose.

import os
import tempfile

with tempfile.TemporaryDirectory() as base:
    public = os.path.join(base, "public")
    os.mkdir(public)
    with open(os.path.join(public, "report.txt"), "w") as f:
        f.write("quarterly report")
    with open(os.path.join(base, "secret.txt"), "w") as f:
        f.write("the secret key")

    def read_file(name):
        with open(os.path.join(public, name)) as f:
            return f.read()

    print(read_file("report.txt"))
    print(read_file("../secret.txt"))
    print(read_file(os.path.join(base, "secret.txt")))
Output
quarterly report
the secret key
the secret key

Both calls read the secret file. .. climbs out of public, and os.path.join drops every segment before an absolute segment.7 The same weakness appears with filepath.Join in Go, Path.resolve in Java, path.join in Node.js, Path.Combine in .NET and Path::join in Rust. The example files show each one.

Fixed code

The function resolves the joined path and then checks that the result is inside the resolved root. Path.resolve makes the path absolute, follows symbolic links and removes .. components. is_relative_to compares whole components, not text.8

import os
import tempfile
from pathlib import Path

with tempfile.TemporaryDirectory() as base:
    public = Path(base, "public")
    public.mkdir()
    (public / "report.txt").write_text("quarterly report")
    Path(base, "secret.txt").write_text("the secret key")
    os.symlink(Path(base, "secret.txt"), public / "link.txt")

    root = public.resolve()

    def read_file(name):
        path = (root / name).resolve()
        if not path.is_relative_to(root):
            raise PermissionError("the path is outside the public directory")
        return path.read_text()

    tests = [
        ("report.txt", "report.txt"),
        ("../secret.txt", "../secret.txt"),
        ("an absolute path", str(Path(base, "secret.txt"))),
        ("a symlink out", "link.txt"),
    ]
    for label, name in tests:
        try:
            print(f"{label}: {read_file(name)}")
        except PermissionError as error:
            print(f"{label}: refused, {error}")
Output
report.txt: quarterly report
../secret.txt: refused, the path is outside the public directory
an absolute path: refused, the path is outside the public directory
a symlink out: refused, the path is outside the public directory

The order matters. The check comes after the resolve, so it sees the path that open will use. A check before the resolve, or a check on strings, fails. The Python example file shows a startswith check that a sibling directory such as public-old passes. Java's Path.startsWith, Rust's Path::starts_with and Python's os.path.commonpath compare components and do not have this problem.11147

The check and the open

A check and a later open are two steps. If another process can change the directory between them, it can put a symbolic link where a file was. Go's os.Root closes this gap. It opens the directory once, and each method on the root refuses a name with a component that leads outside, and refuses a symbolic link that points outside.10 Its documentation also lists what it does not stop: it does not stop traversal of file system boundaries, Linux bind mounts, /proc special files or access to Unix device files.10 The Go example file shows it.

Avoid the name

OWASP puts first a design without user input in file system calls. It suggests an index: the user sends 5, and the program maps 5 to a file name that it chose.6 A key in a database row works in the same way. When the program must take a name, it should not let the user supply all parts of the path, and it should accept only known good input and not try to clean bad input.6

How to detect it

  • Static analysis with taint tracking. CodeQL follows input from a request to a file system call. Its queries are py/path-injection, js/path-injection, java/path-injection, go/path-injection and cs/path-injection, and py/tarslip follows archive member names to the file system.1516
  • Pattern linters. gosec rule G304 reports a file path from input, G305 reports path traversal in zip extraction, and G703 follows input to a file path.18 Ruff rule S202 reports calls to tarfile.extractall.17
  • Code review. Search for open, send_file, ReadFile, File, Path.Combine, os.path.join, extractall and the unzip code. For each call, ask if any part of the path comes from input, and where the check is.
  • Tests. Put ../ and an absolute path through each input that names a file, and put an archive with a member named ../outside.txt through each extract step. The program must refuse them.

How to prevent it

  • Take no path from input. Map an index or an id to a file name that the program chose.6
  • Open through a root. Where the platform has it, use an API that opens files beneath one directory and refuses names and links that lead out, such as Go's os.Root.10
  • Resolve, then check. Resolve the joined path, following links, and check by components that it is inside the resolved root.18 Decode the input fully before the check.1
  • Allow-list file names. Limit the characters, allow at most one ., exclude directory separators, and allow only listed extensions.1 Do not remove ../ from the input. CWE-22 warns that a filter can leave a new ../ behind.1
  • Extract archives with a filter. Check each member name before it is written, or use a filter such as the data filter of tarfile.9
  • Use least privilege. Run the program with an account that cannot read or write files outside its data. A jail or a sandbox limits the files that the process can reach.16

Real cases

Case Date What happened
VU#111677 2000-10-10 Microsoft IIS 4 and 5 failed to stop a relative reference encoded with certain unicode characters, so a visitor could read files outside the web folder and run programs in it.45
CVE-2007-4559 published 2007-08-28 The extract and extractall functions of Python's tarfile module let a .. sequence in a member name overwrite files.19
CVE-2019-10743 published 2019-10-28 Zip Slip in the archiver library for Go: a member name was joined to the destination directory, so the file landed outside it.201
CVE-2020-3452 published 2020-07-22 Directory traversal in the web services interface of Cisco ASA and FTD software let an unauthenticated attacker read sensitive files. CWE-22 says that it was exploited in the wild.211
CVE-2021-41773 published 2021-10-05 A change to path normalization in Apache HTTP Server 2.4.49 let requests map to files outside the directories of Alias-like directives, and with CGI enabled, to code execution. The record says that it was exploited in the wild.22
CVE-2022-31503 published 2022-07-11 orchest passed input to Flask's send_file, and an absolute path read files outside the intended directory. CWE-22 says that os.path.join reset the path to the absolute input.231
PythonGitHub

This code runs but gives a wrong answer on purpose.

import os
import tempfile

with tempfile.TemporaryDirectory() as base:
    public = os.path.join(base, "public")
    os.mkdir(public)
    with open(os.path.join(public, "report.txt"), "w") as f:
        f.write("quarterly report")
    with open(os.path.join(base, "secret.txt"), "w") as f:
        f.write("the secret key")

    def read_file(name):
        with open(os.path.join(public, name)) as f:
            return f.read()

    print(read_file("report.txt"))
    print(read_file("../secret.txt"))
    print(read_file(os.path.join(base, "secret.txt")))
Output
quarterly report
the secret key
the secret key

The second call climbs out of public with ... The third call passes an absolute path, and os.path.join drops every segment before an absolute segment.

This code runs but gives a wrong answer on purpose.

import os

public = "/srv/app/public"
for name in ["report.txt", "../secret.txt"]:
    path = os.path.join(public, name)
    print(path, path.startswith(public))

print("/srv/app/public-old/notes.txt".startswith(public))
Output
/srv/app/public/report.txt True
/srv/app/public/../secret.txt True
True

A string check on a path that is not normalized fails in two ways. public/../secret.txt starts with public, so the check passes. And public-old starts with the text public, so a sibling directory passes too.

import os
import tempfile
from pathlib import Path

with tempfile.TemporaryDirectory() as base:
    public = Path(base, "public")
    public.mkdir()
    (public / "report.txt").write_text("quarterly report")
    Path(base, "secret.txt").write_text("the secret key")
    os.symlink(Path(base, "secret.txt"), public / "link.txt")

    root = public.resolve()

    def read_file(name):
        path = (root / name).resolve()
        if not path.is_relative_to(root):
            raise PermissionError("the path is outside the public directory")
        return path.read_text()

    tests = [
        ("report.txt", "report.txt"),
        ("../secret.txt", "../secret.txt"),
        ("an absolute path", str(Path(base, "secret.txt"))),
        ("a symlink out", "link.txt"),
    ]
    for label, name in tests:
        try:
            print(f"{label}: {read_file(name)}")
        except PermissionError as error:
            print(f"{label}: refused, {error}")
Output
report.txt: quarterly report
../secret.txt: refused, the path is outside the public directory
an absolute path: refused, the path is outside the public directory
a symlink out: refused, the path is outside the public directory
import io
import tarfile
import tempfile

# Make an archive in memory with one member whose name climbs out.
buffer = io.BytesIO()
with tarfile.open(fileobj=buffer, mode="w") as tar:
    data = b"text"
    member = tarfile.TarInfo("../outside.txt")
    member.size = len(data)
    tar.addfile(member, io.BytesIO(data))

buffer.seek(0)
with tempfile.TemporaryDirectory() as dest, tarfile.open(fileobj=buffer) as tar:
    try:
        tar.extractall(dest, filter="data")
    except tarfile.OutsideDestinationError as error:
        print(type(error).__name__)
Output
OutsideDestinationError
  • Verdict: stdlib. Path.resolve (or os.path.realpath) makes the path absolute, removes . and .., and follows symbolic links. Path.is_relative_to then compares whole path components, not text. The check must come after the resolve.
  • os.path.join and the / operator of pathlib drop the earlier segments when a later segment is absolute. Never pass input as a later segment without the check.
  • os.path.commonpath([root, path]) == root is the same check for code that uses strings.
  • A check and a later open are two steps. If another process can change the directory between them, it can swap a file for a symbolic link. Where other users can write to the directory, the check is not enough.
  • The fourth example shows the extraction filters of tarfile. The data filter refuses members that would land outside the destination, and links to absolute paths. It is the default filter, and the documentation still says never to extract archives from untrusted sources without prior inspection. zipfile removes .. and leading slashes from member names when it extracts.
  • Ruff rule S202 reports calls to tarfile.extractall, and its documentation recommends filter='data'. CodeQL queries py/path-injection and py/tarslip follow input to file operations and archive members to the file system.
JavaGitHub

This code runs but gives a wrong answer on purpose.

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws IOException {
        Path base = Files.createTempDirectory("traversal");
        Path publicDir = Files.createDirectory(base.resolve("public"));
        Files.writeString(publicDir.resolve("report.txt"), "quarterly report");
        Files.writeString(base.resolve("secret.txt"), "the secret key");

        System.out.println(Files.readString(publicDir.resolve("report.txt")));
        System.out.println(Files.readString(publicDir.resolve("../secret.txt")));
        System.out.println(Files.readString(publicDir.resolve(base.resolve("secret.txt").toString())));
    }
}
Output
quarterly report
the secret key
the secret key
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    static Path root;

    static String readFile(String name) throws IOException {
        Path path = root.resolve(name).normalize();
        if (!path.startsWith(root) || !path.toRealPath().startsWith(root)) {
            return "refused, the path is outside the public directory";
        }
        return Files.readString(path);
    }

    public static void main(String[] args) throws IOException {
        Path base = Files.createTempDirectory("traversal").toRealPath();
        root = Files.createDirectory(base.resolve("public"));
        Files.writeString(root.resolve("report.txt"), "quarterly report");
        Files.writeString(base.resolve("secret.txt"), "the secret key");
        Files.createSymbolicLink(root.resolve("link.txt"), Path.of("../secret.txt"));

        System.out.println(readFile("report.txt"));
        System.out.println(readFile("../secret.txt"));
        System.out.println(readFile(base.resolve("secret.txt").toString()));
        System.out.println(readFile("link.txt"));
        System.out.println(Path.of("/srv/public-old/a.txt").startsWith(Path.of("/srv/public")));
    }
}
Output
quarterly report
refused, the path is outside the public directory
refused, the path is outside the public directory
refused, the path is outside the public directory
false
  • Verdict: stdlib. Path.resolve joins a name to a directory, and returns the other path as it is when the other path is absolute. normalize removes . and ... Path.startsWith compares whole name elements, so /srv/public-old does not start with /srv/public.
  • normalize works on the text and does not know about symbolic links. toRealPath follows them, so the second example checks both. toRealPath fails with NoSuchFileException when the file does not exist.
  • String.startsWith on path strings has the sibling problem. Use Path.startsWith.
  • CodeQL queries java/path-injection and java/zipslip follow input and archive entry names to file operations.

This code runs but gives a wrong answer on purpose.

var root = "/srv/app/public";
foreach (var name in new[] { "report.txt", "../secret.txt", "/etc/hosts" })
{
    Console.WriteLine(Path.Combine(root, name));
}
Output
/srv/app/public/report.txt
/srv/app/public/../secret.txt
/etc/hosts
static string? LocalPath(string root, string name)
{
    var fullRoot = Path.GetFullPath(root) + Path.DirectorySeparatorChar;
    var full = Path.GetFullPath(Path.Join(fullRoot, name));
    return full.StartsWith(fullRoot, StringComparison.Ordinal) ? full : null;
}

foreach (var name in new[] { "report.txt", "../secret.txt", "/etc/hosts", "../public-old/a.txt" })
{
    Console.WriteLine($"{name}: {LocalPath("/srv/app/public", name) ?? "refused"}");
}
Output
report.txt: /srv/app/public/report.txt
../secret.txt: refused
/etc/hosts: /srv/app/public/etc/hosts
../public-old/a.txt: refused
  • Verdict: stdlib. Path.Combine returns the second path when it is absolute. Its documentation says to call Path.Join or Path.TryJoin when later arguments come from the user. Path.Join keeps the first path.
  • Path.GetFullPath makes the path absolute and removes . and .. by text. The prefix check adds a separator to the root, so /srv/app/public-old does not pass for /srv/app/public.
  • GetFullPath does not follow symbolic links. Where other users can create links, resolve them with FileSystemInfo.ResolveLinkTarget or open the file and check its final path.
  • On Windows, use StringComparison.OrdinalIgnoreCase, because the file system ignores case.
  • CodeQL query cs/path-injection follows input from a request to file system calls.
JavaScriptGitHub

This code runs but gives a wrong answer on purpose.

const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");

const base = fs.mkdtempSync(path.join(os.tmpdir(), "traversal-"));
const publicDir = path.join(base, "public");
fs.mkdirSync(publicDir);
fs.writeFileSync(path.join(publicDir, "report.txt"), "quarterly report");
fs.writeFileSync(path.join(base, "secret.txt"), "the secret key");

function readFile(name) {
  return fs.readFileSync(path.join(publicDir, name), "utf8");
}

console.log(readFile("report.txt"));
console.log(readFile("../secret.txt"));
fs.rmSync(base, { recursive: true });
Output
quarterly report
the secret key
const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");

const base = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), "traversal-")));
const publicDir = path.join(base, "public");
fs.mkdirSync(publicDir);
fs.writeFileSync(path.join(publicDir, "report.txt"), "quarterly report");
fs.writeFileSync(path.join(base, "secret.txt"), "the secret key");
fs.symlinkSync("../secret.txt", path.join(publicDir, "link.txt"));

function readFile(name) {
  const full = fs.realpathSync(path.resolve(publicDir, name));
  const rel = path.relative(publicDir, full);
  if (rel === "" || rel.startsWith("..") || path.isAbsolute(rel)) {
    return "refused, the path is outside the public directory";
  }
  return fs.readFileSync(full, "utf8");
}

console.log(readFile("report.txt"));
console.log(readFile("../secret.txt"));
console.log(readFile(path.join(base, "secret.txt")));
console.log(readFile("link.txt"));
fs.rmSync(base, { recursive: true });
Output
quarterly report
refused, the path is outside the public directory
refused, the path is outside the public directory
refused, the path is outside the public directory
  • Verdict: stdlib. path.resolve makes an absolute path and removes . and ... It processes its arguments from right to left and stops at the first absolute one, so an absolute name replaces the directory. fs.realpathSync also follows symbolic links.
  • path.relative(root, full) gives the way from the root to the file. If it starts with .. or is absolute, the file is outside the root. This avoids the sibling problem of a string prefix check.
  • path.join does not stop ... It removes .. by climbing up, which is the bug.
  • fs.realpathSync fails when the file does not exist. For a file that the program will create, resolve the directory part, check it, and then add the last name.
  • Check the path that the file system call gets, after all decoding of the request. A check on the raw URL can miss a name that a later step decodes to ...
  • CodeQL query js/path-injection follows input from a request to file system calls.

This code runs but gives a wrong answer on purpose.

package main

import (
	"fmt"
	"os"
	"path/filepath"
)

func main() {
	base, _ := os.MkdirTemp("", "traversal")
	defer os.RemoveAll(base)
	public := filepath.Join(base, "public")
	os.Mkdir(public, 0o755)
	os.WriteFile(filepath.Join(public, "report.txt"), []byte("quarterly report"), 0o644)
	os.WriteFile(filepath.Join(base, "secret.txt"), []byte("the secret key"), 0o644)

	readFile := func(name string) string {
		data, err := os.ReadFile(filepath.Join(public, name))
		if err != nil {
			return "error: " + err.Error()
		}
		return string(data)
	}

	fmt.Println(readFile("report.txt"))
	fmt.Println(readFile("../secret.txt"))
	fmt.Println(filepath.Join("public", "/etc/hosts"))
}
Output
quarterly report
the secret key
public/etc/hosts
package main

import (
	"fmt"
	"io"
	"os"
	"path/filepath"
)

func main() {
	base, _ := os.MkdirTemp("", "traversal")
	defer os.RemoveAll(base)
	public := filepath.Join(base, "public")
	os.Mkdir(public, 0o755)
	os.WriteFile(filepath.Join(public, "report.txt"), []byte("quarterly report"), 0o644)
	os.WriteFile(filepath.Join(base, "secret.txt"), []byte("the secret key"), 0o644)
	os.Symlink("../secret.txt", filepath.Join(public, "link.txt"))

	root, err := os.OpenRoot(public)
	if err != nil {
		panic(err)
	}
	defer root.Close()

	readFile := func(name string) string {
		f, err := root.Open(name)
		if err != nil {
			return "error: " + err.Error()
		}
		defer f.Close()
		data, _ := io.ReadAll(f)
		return string(data)
	}

	fmt.Println(readFile("report.txt"))
	fmt.Println(readFile("../secret.txt"))
	fmt.Println(readFile("link.txt"))
	fmt.Println(filepath.IsLocal("report.txt"), filepath.IsLocal("../secret.txt"), filepath.IsLocal("/etc/hosts"))
}
Output
quarterly report
error: openat ../secret.txt: path escapes from parent
error: openat link.txt: path escapes from parent
true false false
  • Verdict: stdlib. os.Root opens a directory once. Its methods accept only names that stay beneath the directory, and return an error for a name with .. that leaves it, or for a symbolic link that points out of it.
  • On most platforms, OpenRoot opens a file descriptor of the directory, and the methods work relative to it. A separate check of the name before an open can race with another process that changes the directory. The documentation of os.Root lists its limits: it does not stop the crossing of file system boundaries or bind mounts, and on some platforms it does not stop such races.
  • filepath.Join cleans the result, so public/../secret.txt becomes secret.txt next to public. Unlike the join functions of Python, Java, .NET and Rust, it does not drop the earlier segments for an absolute segment.
  • filepath.IsLocal checks a name by its text alone. It does not look at symbolic links, so use it as a first check and os.Root for the open.
  • gosec rule G304 reports file paths that come from input, G305 reports archive members written with no check, and G703 follows input to file operations. CodeQL queries go/path-injection and go/zipslip do the same.
RustGitHub

This code runs but gives a wrong answer on purpose.

use std::path::Path;

fn main() {
    let public = Path::new("/srv/app/public");
    for name in ["report.txt", "../secret.txt", "/etc/hosts"] {
        println!("{}", public.join(name).display());
    }
}
Output
/srv/app/public/report.txt
/srv/app/public/../secret.txt
/etc/hosts

Path::join keeps .. as a component, and the operating system climbs out when it opens the path. An absolute name replaces the whole path.

use std::path::{Component, Path, PathBuf};

// Accept only plain names: no root, no drive prefix, no "..".
fn local_path(root: &Path, name: &str) -> Result<PathBuf, String> {
    let mut path = root.to_path_buf();
    for part in Path::new(name).components() {
        match part {
            Component::Normal(p) => path.push(p),
            Component::CurDir => {}
            _ => return Err(format!("refused {name:?}")),
        }
    }
    Ok(path)
}

fn main() {
    let public = Path::new("/srv/app/public");
    for name in ["report.txt", "docs/./guide.txt", "../secret.txt", "/etc/hosts"] {
        match local_path(public, name) {
            Ok(path) => println!("{}", path.display()),
            Err(error) => println!("{error}"),
        }
    }
}
Output
/srv/app/public/report.txt
/srv/app/public/docs/guide.txt
refused "../secret.txt"
refused "/etc/hosts"
  • Verdict: stdlib. Path::components splits a path into typed parts: RootDir, Prefix (a Windows drive), ParentDir for .., CurDir for . and Normal for a name. A function that accepts only Normal and CurDir cannot leave the root by its text.
  • PathBuf::push and Path::join replace the path when the new part is absolute.
  • The check is lexical. It does not see a symbolic link inside the root that points out. Where other users can create links, call fs::canonicalize on the result and check that it starts with the canonical root. Path::starts_with compares whole components.
  • The standard library has no openat-style API that keeps every open beneath a directory.

References

  1. CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), Description; Extended Description; Alternate Terms; Common Consequences; Potential Mitigations; Relationships; Observed Examples
  2. OWASP Top 10:2025, A01:2025 Broken Access Control, List of Mapped CWEs
  3. 2025 CWE Top 25 Most Dangerous Software Weaknesses, the ranked list, rank 6, CVEs in KEV
  4. CERT/CC Vulnerability Note VU#111677, Microsoft IIS 4.0 / 5.0 vulnerable to directory traversal via extended unicode in url, Overview; Description; Date Public
  5. CVE-2000-0884, Microsoft IIS 4.0 and 5.0, the description and the publication date
  6. OWASP Community, Path Traversal, Overview; How to protect yourself
  7. The Python Standard Library, os.path, Python 3.14, os.path.join; os.path.commonpath; os.path.realpath
  8. The Python Standard Library, pathlib, Python 3.14, PurePath.is_relative_to; Path.resolve
  9. The Python Standard Library, tarfile, Python 3.14, Extraction filters; OutsideDestinationError
  10. Go standard library, package os, type Root, type Root; OpenRoot; OpenInRoot
  11. Java SE 25 API, java.nio.file.Path, normalize; startsWith; toRealPath
  12. Node.js documentation, Path, path.resolve; path.relative
  13. .NET API, Path.Combine Method, Remarks
  14. Rust standard library, std::path::PathBuf, PathBuf::push
  15. CodeQL query help, Uncontrolled data used in path expression (py/path-injection), Recommendation; Example
  16. CodeQL query help, Arbitrary file write during tarfile extraction (py/tarslip), the query description
  17. Ruff rules, tarfile-unsafe-members (S202), What it does; Why is this bad?
  18. gosec rules, G304, G305 and G703
  19. CVE-2007-4559, Python tarfile, the description and the publication date
  20. CVE-2019-10743, archiver, the description and the publication date
  21. CVE-2020-3452, Cisco ASA and FTD web services interface, the description and the publication date
  22. CVE-2021-41773, Apache HTTP Server 2.4.49, the description and the publication date
  23. CVE-2022-31503, orchest, the description and the publication date

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/HZ0NPM/text.yaml