ghsa-wm7q-rxch-43mx
Vulnerability from github
Published
2020-09-01 19:38
Modified
2020-08-31 18:29
VLAI Severity ?
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.
Example:
Here we have a server that ignores the file test.txt.
const serve = require('serve')
const server = serve(__dirname, {
port: 1337,
ignore: ['test.txt']
})
Using the URL encoded form of a letter (%65 instead of e) attacker can bypass the ignore control accessing the file.
curl http://localhost:1337/t%65st.txt
Additionally this technique can be used to get directory listings of ignored directories.
Recommendation
Update to version 6.5.2 or later.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "serve"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "6.5.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:29:10Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"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(\u0027serve\u0027)\nconst server = serve(__dirname, {\n port: 1337,\n ignore: [\u0027test.txt\u0027]\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.",
"id": "GHSA-wm7q-rxch-43mx",
"modified": "2020-08-31T18:29:10Z",
"published": "2020-09-01T19:38:33Z",
"references": [
{
"type": "WEB",
"url": "https://hackerone.com/reports/308721"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/594"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Byass due to validation before canonicalization in serve"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…