CVE-2022-1243: CRHTLF can lead to invalid protocol extraction potentially leading to XSS in medialize/uri.js

Published Apr 5, 2022
·
Updated

\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}) })

Other sources

CRHTLF can lead to invalid protocol extraction potentially leading to XSS in GitHub repository medialize/uri.js prior to 1.19.11.

Affected Software

2 affected componentsFixes available
npm/urijs<1.19.11
1.19.11
Uri.js Project Uri.js<1.19.11

Event History

Apr 5, 2022
CVE Published
via MITRE·03:05 PM
Data Sourced
via MITRE·03:05 PM
DescriptionSeverityWeakness
Apr 6, 2022
Advisory Published
12:01 AM

Frequently Asked Questions

1

What is CVE-2022-1243?

CVE-2022-1243 is a vulnerability where \r, \n, and \t characters in user-input URLs can lead to incorrect protocol extraction when using npm package urijs prior to version 1.19.11.

2

What is the severity of CVE-2022-1243?

The severity of CVE-2022-1243 is high with a CVSS score of 7.2.

3

How does CVE-2022-1243 lead to XSS?

CVE-2022-1243 can lead to XSS when the module is used to prevent passing in malicious javascript: links into HTML or JavaScript.

4

Which software versions are affected by CVE-2022-1243?

Versions of npm package urijs prior to 1.19.11 are affected by CVE-2022-1243.

5

How can CVE-2022-1243 be fixed?

To fix CVE-2022-1243, update to version 1.19.11 or later of the urijs npm package.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203