CVE-2022-25931: easy-static-server vulnerable to Directory Traversal
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.53615%
CWE
Published
12/20/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 |
---|---|---|---|
easy-static-server | npm | <= 0.1.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from line 27 in index.js where user-controlled req.url is parsed and joined with the root directory without proper path normalization or sandboxing. The code uses path.join() which doesn't resolve relative paths when combined with user input, allowing attackers to use '../' sequences to access files outside the intended directory. The lack of additional checks like path.resolve(), path.normalize(), or root directory validation makes this a clear path traversal vulnerability. The proof of concept demonstrates this by accessing ../../package.json, confirming the exploit works as described.