🛡️ CVE-2022-0691 — url-parse

🔴 CVSS 9.8 — Critical ⚠️ Exploit Public CWE-639 OSV
9.8
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

url-parse incorrectly parses hostname / protocol due to unstripped leading control characters.

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

})

```

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity low, availability none.

Weakness class

CVE-2022-0691 is classified as CWE-639: Authorization Bypass Through User-Controlled Key. An object is selected by an identifier from the request without checking the caller owns it.

Affected software

CVE-2022-0691 is recorded against 1 package.

  • url-parse

Timeline and source

Published on 22 February 2022 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Package)
huntr.dev (Web)
lists.debian.org (Web)
security.netapp.com (Web)

CVE-2022-0691 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity CRITICAL
CVSS Score 9.8
CVSS Vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
CWE CWE-639
Public Exploit ⚠️ Yes
Source OSV
Published 2022-02-22
Updated 2026-08-12
Modified 2026-06-17

Affected Packages

Software From version Fixed in
url-parse

Similar Threats

Exploit Protection

Are you running url-parse?

CVE-2022-0691 carries CVSS 9.8 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2022-0691 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.