CVE-2022-25936
Description
Versions of the package servst before 2.0.3 are vulnerable to Directory Traversal due to improper sanitization of the filePath variable.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
servst versions before 2.0.3 are vulnerable to directory traversal, allowing attackers to access files outside the intended root directory.
Vulnerability
Overview
The servst package, a simple HTTP file server for Node.js, is vulnerable to Directory Traversal in versions prior to 2.0.3 [1]. The root cause is improper sanitization of the filePath variable, which allows an attacker to bypass path restrictions using sequences like ../ and their URL-encoded variants [2].
Exploitation
Details
The vulnerability lies in the path normalization logic in the index.js file. Although the code decodes the URI and normalizes the path, it only checks if the filePath starts with the root path using indexOf. This check can be circumvented because a path like /../public-isprivate/index.html does not start with the root prefix after normalization, leading to incorrect access control [3]. The attack requires no authentication and can be executed over HTTP if the servst server is exposed to the network.
Impact
An unauthenticated attacker can read arbitrary files on the server filesystem, including application source code, configuration files, and other sensitive data [2]. The directory traversal can also potentially be used to list directory contents, leading to information disclosure [3].
Mitigation
The vulnerability has been patched in version 2.0.3. Users should upgrade to this version or later [1]. There is no known workaround. As of publication, the package has limited usage and is no longer actively maintained [3].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
servstnpm | < 2.0.3 | 2.0.3 |
Affected products
3- servst/servstdescription
- Range: <2.0.3
Patches
1f7cae5d2d7c6Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-88v8-v46g-6c9wghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-25936ghsaADVISORY
- gist.github.com/lirantal/691d02d607753d54856f9335f9a1692fghsaWEB
- github.com/andrepolischuk/servst/commit/f7cae5d2d7c64c86bc512e1e50614240396ef114ghsaWEB
- security.snyk.io/vuln/SNYK-JS-SERVST-3244896ghsaWEB
News mentions
0No linked articles in our index yet.