{"id":"GHSA-wm7q-rxch-43mx","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.","modified":"2020-08-31T18:29:10Z","published":"2020-09-01T19:38:33Z","database_specific":{"nvd_published_at":null,"cwe_ids":[],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2020-08-31T18:29:10Z"},"references":[{"type":"WEB","url":"https://hackerone.com/reports/308721"},{"type":"WEB","url":"https://www.npmjs.com/advisories/594"}],"affected":[{"package":{"name":"serve","ecosystem":"npm","purl":"pkg:npm/serve"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"6.5.2"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-wm7q-rxch-43mx/GHSA-wm7q-rxch-43mx.json"}}],"schema_version":"1.9.0"}