{"id":"GHSA-wm7q-rxch-43mx","aliases":["GHSA-wm7q-rxch-43mx"],"related":[],"kind":"vulnerability","state":"published","title":"Byass due to validation before canonicalization in serve","summary":"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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2020-09-01T19:38:33.000Z","modified":"2020-08-31T18:29:10.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.5.2"}],"ecosystem":"npm","package":"serve","purl":"pkg:npm/serve","source":"ghsa"}],"references":[{"url":"https://hackerone.com/reports/308721","tags":["web"],"sources":["ghsa"]},{"url":"https://www.npmjs.com/advisories/594","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wm7q-rxch-43mx","url":"https://github.com/advisories/GHSA-wm7q-rxch-43mx","licence":"CC-BY-4.0","modified":"2020-08-31T18:29:10.000Z"}],"updatedAt":"2026-11-25T22:56:46.865Z"}