GHSA-wm7q-rxch-43mx: Serve Byass Due To Validation Before Vulnerability
HIGHGHSA-wm7q-rxch-43mx is a HIGH byass due to validation before vulnerability (General Security Weakness) affecting Serve libraries in the npm ecosystem. The issue involves byass due to validation before canonicalization in serve. Remediation is available by upgrading affected packages to version 6.5.2.
GHSA-wm7q-rxch-43mx at a Glance
How to Fix GHSA-wm7q-rxch-43mx
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@6.5.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-wm7q-rxch-43mx, 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 6.5.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 General Security Weakness. 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-wm7q-rxch-43mx Affected Serve Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
serve
|
npm |
< 6.5.2
|
6.5.2
|
References
Frequently Asked Questions
What is GHSA-wm7q-rxch-43mx?
Which Serve versions are affected?
What version fixes GHSA-wm7q-rxch-43mx?
Is serve affected?
What CWE is associated with GHSA-wm7q-rxch-43mx?
How can I check npm dependencies for GHSA-wm7q-rxch-43mx?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wm7q-rxch-43mx",
"modified" : "2020-08-31T18:29:10Z",
"published" : "2020-09-01T19:38:33Z",
"aliases" : [ ],
"summary" : "Byass due to validation before canonicalization in serve",
"details" : "Versions of `serve` before 6.5.2 are vulnerable to the bypass of the ignore functionality. The bypass is possible because validation happens before canonicalization of paths and filenames.\n\n\n\nExample:\nHere we have a server that ignores the file test.txt.\n```\nconst serve = require('serve')\nconst server = serve(__dirname, {\n port: 1337,\n ignore: ['test.txt']\n})\n```\n\nUsing the URL encoded form of a letter (%65 instead of e) attacker can bypass the ignore control accessing the file. \n\n`curl http://localhost:1337/t%65st.txt`\n\nAdditionally this technique can be used to get directory listings of ignored directories.\n\n\n## Recommendation\n\nUpdate to version 6.5.2 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "serve"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.5.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://hackerone.com/reports/308721"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/594"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:29:10Z",
"nvd_published_at" : null
}
}