CVE-2022-25848: static-dev-server vulnerable to path traversal
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.29496%
CWE
Published
11/29/2022
Updated
1/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| static-dev-server | npm | = 1.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key issues: (1) The path.join() call naively combines user input (URI) with the root directory, enabling traversal attempts. (2) The validPath function's validation logic (using indexOf instead of strict path comparison) fails to properly restrict access to the root directory. The PoC demonstrates that paths like '../public-isprivate' bypass validation because 'public-isprivate' starts with the rootPath 'public', passing the indexOf check. This combination of improper path joining and weak validation enables directory traversal.