Vulnerabilities in pkg:npm/serve-lite
PACKAGECVE-2022-21192 is a HIGH (CVSS 7.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Serve lite libraries in the npm ecosystem. The issue involves directory traversal vulnerability in serve-lite. Remediation is available in the latest vendor maintenance releases.
pkg:npm/serve-lite
Vulnerability advisories affecting package pkg:npm/serve-lite. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5qq4-m6c3-xxmf | CVE-2022-21192 | HIGH | Directory Traversal vulnerability in serve-lite |
| GHSA-j8x7-qcw4-xx85 | CVE-2022-25847 | MODERATE | Cross-site Scripting (XSS) in serve-lite |
CVE-2022-21192 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2022-21192
To remediate this vulnerability, upgrade all affected Serve lite dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install serve-lite@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls serve-lite
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-21192, inspect your project dependencies using npm:
npm ls serve-lite
Analyze the terminal output to locate any version of Serve lite in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls serve-lite command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Serve lite, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-21192 Affected Serve lite Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
serve-lite
|
npm |
≤ 1.1.0
|
|
References
Frequently Asked Questions
What is CVE-2022-21192?
Which Serve lite versions are affected?
What version fixes CVE-2022-21192?
Is serve-lite affected?
What is the CVSS score of CVE-2022-21192?
What CWE is associated with CVE-2022-21192?
How can I check npm dependencies for CVE-2022-21192?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5qq4-m6c3-xxmf",
"modified" : "2025-04-01T22:56:48Z",
"published" : "2023-01-26T21:30:28Z",
"aliases" : [ "CVE-2022-21192" ],
"summary" : "Directory Traversal vulnerability in serve-lite",
"details" : "All versions of the package serve-lite are vulnerable to Directory Traversal due to missing input sanitization or other checks and protections employed to the req.url passed as-is to path.join().",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "serve-lite"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "1.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21192"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/lirantal/9ccdfda0edcb95e36d07a04b0b6c2db0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/beenotung/serve-lite"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-SERVELITE-3149916"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-01-30T18:17:38Z",
"nvd_published_at" : "2023-01-26T21:15:00Z"
}
}