GHSA-48gc-5j93-5cfq: Serve Path Traversal Vulnerability
HIGHGHSA-48gc-5j93-5cfq is a HIGH path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Serve libraries in the npm ecosystem. The issue involves path traversal in serve. Remediation is available by upgrading affected packages to version 10.1.2.
GHSA-48gc-5j93-5cfq at a Glance
How to Fix GHSA-48gc-5j93-5cfq
To remediate this vulnerability, upgrade all affected Serve 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@10.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls serve
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-48gc-5j93-5cfq, inspect your project dependencies using npm:
npm ls serve
Analyze the terminal output to locate any version of Serve in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.1.2), your application is affected.
Note: The npm ls serve 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, 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
GHSA-48gc-5j93-5cfq Affected Serve Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
serve
|
npm |
< 10.1.2
|
10.1.2
|
References
Frequently Asked Questions
What is GHSA-48gc-5j93-5cfq?
Which Serve versions are affected?
What version fixes GHSA-48gc-5j93-5cfq?
Is serve affected?
What CWE is associated with GHSA-48gc-5j93-5cfq?
How can I check npm dependencies for GHSA-48gc-5j93-5cfq?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-48gc-5j93-5cfq",
"modified" : "2020-08-31T18:42:15Z",
"published" : "2020-09-11T21:15:54Z",
"aliases" : [ ],
"summary" : "Path Traversal in serve",
"details" : "Versions of `serve` prior to 10.1.2 are vulnerable to Path Traversal. Explicitly ignored folders can be accessed through relative paths, which allows attackers to access hidden folders and files.\n\n\n## Recommendation\n\nUpgrade to version 10.1.2 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "serve"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://hackerone.com/reports/486933"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/965"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:42:15Z",
"nvd_published_at" : null
}
}