CVE-2024-56198: path-sanitizer allows bypassing the existing filters to achieve path-traversal vulnerability
N/A
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
0.45329%
CWE
Published
1/2/2025
Updated
1/2/2025
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
-
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| path-sanitizer | npm | < 3.1.0 | 3.1.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the sanitize function's inadequate handling of:
- URL-encoded characters like %5c (backslash) that could be used to bypass slash-based filtering
- Recursive parent directory patterns that weren't properly normalized in a loop
- Multiple consecutive traversal sequences that could escape the target directory
The commit diff shows critical changes in lib/index.ts adding a while loop and additional regex patterns to address these issues, confirming the original implementation in this file was vulnerable. The PoC demonstrates that specially crafted inputs could bypass the original sanitization logic through encoding and path concatenation attacks.