CVE-2026-41245: Path Traversal Partial Prefix

Checking if a path starts with another path's canonical or absolute path using `String.startsWith()` is vulnerable to partial path traversal (often called a Zip Slip variant). An attacker can use a sibling directory sharing the same prefix (e.g., `/app/data_evil` vs `/app/data`). Ensure that you append a directory separator (e.g., `File.separator`) to the in

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Javaβ
greprules fetch cve-2026-41245-path-traversal-partial-prefix --engine opengrep

Description

Checking if a path starts with another path's canonical or absolute path using `String.startsWith()` is vulnerable to partial path traversal (often called a Zip Slip variant). An attacker can use a sibling directory sharing the same prefix (e.g., `/app/data_evil` vs `/app/data`). Ensure that you append a directory separator (e.g., `File.separator`) to the in