CVE-2022-0691: Authorization Bypass Through User-Controlled Key in unshiftio/url-parse

Published Feb 21, 2022
·
Updated

An authorization bypass flaw was found in url-parse. This flaw allows a local unauthenticated attacker to add a backspace character (\b) while submitting a URL. This vulnerability can enable bypassing any hostname checks.

Other sources

Authorization Bypass Through User-Controlled Key in NPM url-parse prior to 1.5.9.

Leading control characters in a URL are not stripped when passed into url-parse. This can cause input URLs to be mistakenly be interpreted as a relative URL without a hostname and protocol, while the WHATWG URL parser will trim control characters and treat it as an absolute URL.

If url-parse is used in security decisions involving the hostname / protocol, and the input URL is used in a client which uses the WHATWG URL parser, the decision may be incorrect.

This can also lead to a cross-site scripting (XSS) vulnerability if url-parse is used to check for the javascript: protocol in URLs. See following example: js const parse = require('url-parse') const express = require('express') const app = express() const port = 3000

url = parse(\"\\bjavascript:alert(1)\")

console.log(url)

app.get('/', (req, res) => { if (url.protocol !== \"javascript:\") {res.send(\"<a href=\\'\" + url.href + \"\\'>CLICK ME!</a>\")} })

app.listen(port, () => { console.log(Example app listening on port ${port}) })

unshift.io url-parse module for NPM could allow a remote attacker to bypass security restrictions, caused by improper validation of \b (backspace) character. By sending a specially-crafted request, an attacker could exploit this vulnerability to bypass hostname validation and leads to false positive in the extractProtocol() function.

IBM

Affected Software

9 affected componentsFixes available
npm/url-parse<1.5.9
1.5.9
redhat/url-parse<1.5.9
1.5.9
IBM Data Virtualization on Cloud Pak for Data<=3.0
IBM Watson Query on Cloud Pak for Data<=2.2
IBM Watson Query on Cloud Pak for Data<=2.1
IBM Watson Query on Cloud Pak for Data<=2.0
IBM Data Virtualization on Cloud Pak for Data<=1.8
IBM Data Virtualization on Cloud Pak for Data<=1.7
Url-parse Project Url-parse Node.js<1.5.9

Event History

Feb 21, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Feb 22, 2022
Advisory Published
12:00 AM
Aug 15, 2025
Data Sourced
via IBM·03:29 PM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-0691?

CVE-2022-0691 is a vulnerability that allows authorization bypass through user-controlled key in NPM url-parse prior to version 1.5.9.

2

What is the severity of CVE-2022-0691?

CVE-2022-0691 has a severity rating of critical with a CVSS score of 9.8.

3

What software is affected by CVE-2022-0691?

The npm package 'url-parse' versions prior to 1.5.9, as well as the Red Hat package 'url-parse' versions prior to 1.5.9, and the Url-parse Project Url-parse with versions up to 1.5.9.

4

How can CVE-2022-0691 be exploited?

An attacker can bypass authorization by manipulating the URL and causing it to be interpreted as a relative URL without a hostname and protocol.

5

How can I fix CVE-2022-0691?

Update the affected 'url-parse' packages to version 1.5.9 or higher.

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