# CVE-2022-24723: URI.js leading whitespace bypasses protocol validation

Source: https://junglewise.ai/threats/cve-2022-24723-uri-js-leading-whitespace-bypasses-protocol-validation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-03-03. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2022-24723 · Severity: low · CVSS 3.1 · Published 2022-03-03

URI.js is a JavaScript library used to parse and manipulate URLs. A flaw in whitespace handling allows attackers to craft malicious URLs with leading whitespace that bypass protocol validation checks, potentially enabling phishing attacks or protocol smuggling attacks that could redirect users to unintended destinations.

Technologies: [urijs (npm)](https://junglewise.ai/threats/technologies/urijs). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2022-24723 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-24723 being exploited in the wild.

**How severe is CVE-2022-24723?** Low severity, with a CVSS score of 3.1, published 3 March 2022.

**Which products and versions are affected?** urijs (npm) SEMVER:introduced=0,fixed=1.19.9.

**Is there a fix for CVE-2022-24723?** Yes. urijs (npm): upgrade to 1.19.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2022-24723 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2022-24723?** Check whether you run urijs (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- urijs (npm): upgrade to 1.19.9 or later

  ```sh
  npm install urijs@1.19.9
  ```


## Technical details

The vulnerability is an improper input validation issue (CWE-20) in URI.js where leading whitespace characters are not stripped from URLs before parsing. This causes the protocol validation mechanism to fail, as whitespace-prefixed URLs are not recognized as having a protocol. An attacker can craft a URL with leading whitespace (e.g., "\x00javascript:alert(1)") that bypasses security checks intended to prevent dangerous protocols. The flaw affects all versions prior to 1.19.9 and can be exploited via network delivery of a malicious URL, requiring no authentication or user interaction beyond clicking the link. The patch removes leading whitespace before protocol validation.

## Affected products

- medialize URI.js < 1.19.9

## Identifiers

- CVE-2022-24723
- GHSA-gmv4-r438-p67f

## Timeline

- 2022-03-03: disclosed: Published via GitHub Security Advisory
- 2022-03-03: patched: Fix released in version 1.19.9

## References

- [https://github.com/medialize/URI.js/security/advisories/GHSA-gmv4-r438-p67f](https://github.com/medialize/URI.js/security/advisories/GHSA-gmv4-r438-p67f)

## Related threats

- [medialize urijs incorrect protocol extraction via whitespace characters](https://junglewise.ai/threats/cve-2022-1243-medialize-urijs-incorrect-protocol-extraction-via-whitespace)
- [medialize uri.js URL confusion with missing scheme](https://junglewise.ai/threats/cve-2022-1233-medialize-uri-js-url-confusion-with-missing-scheme)
- [urijs open redirect in URL parsing](https://junglewise.ai/threats/cve-2022-0868-urijs-open-redirect-in-url-parsing)
- [urijs authorization bypass via case-insensitive scheme](https://junglewise.ai/threats/cve-2022-0613-urijs-authorization-bypass-via-case-insensitive-scheme)
- [URIjs hostname spoofing via backslashes in URL](https://junglewise.ai/threats/cve-2021-3647-urijs-hostname-spoofing-via-backslashes-in-url)
