CVE-2022-25936: Servst vulnerable to Path Traversal
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.57481%
CWE
Published
1/30/2023
Updated
2/15/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 |
---|---|---|---|
servst | npm | < 2.0.3 | 2.0.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper path validation in the static file handler. The proof-of-concept demonstrates that paths like '/../public-isprivate' were accessible despite being outside the intended root directory. The key vulnerable code is shown in the Gist analysis where indexOf(root) check passes for sibling directories sharing root's prefix. This check occurs in the main request handling function (statics middleware) in index.js, which was modified in the patched commit to use stricter validation.