logo

CVE-2022-1243 urijs

Package

Manager: npm
Name: urijs
Vulnerable Version: >=0 <1.19.11

Severity

Level: High

CVSS v3.1: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N

CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

EPSS: 0.00318 pctl0.54273

Details

Incorrect protocol extraction via \r, \n and \t characters \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. This can lead to XSS when the module is used to prevent passing in malicious javascript: links into HTML or Javascript (see following example): ```` const parse = require('urijs') const express = require('express') const app = express() const port = 3000 input = "ja\r\nvascript:alert(1)" url = parse(input) console.log(url) app.get('/', (req, res) => { if (url.protocol !== "javascript:") {res.send("<iframe src=\'" + input + "\'>CLICK ME!</iframe>")} }) app.listen(port, () => { console.log(`Example app listening on port ${port}`) }) ````

Metadata

Created: 2022-04-06T00:01:31Z
Modified: 2022-04-14T20:13:56Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/04/GHSA-3vjf-82ff-p4r3/GHSA-3vjf-82ff-p4r3.json
CWE IDs: ["CWE-20"]
Alternative ID: GHSA-3vjf-82ff-p4r3
Finding: F184
Auto approve: 1