CRHTLF can lead to invalid protocol extraction potentially leading to XSS in medialize/uri.js
Description
CRHTLF can lead to invalid protocol extraction potentially leading to XSS in GitHub repository medialize/uri.js prior to 1.19.11.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
CRHTLF in URI.parse() allows injection of CR, LF, or TAB characters, leading to protocol extraction bypass and potential XSS in URI.js before 1.19.11.
Vulnerability
A CRHTLF vulnerability exists in URI.parse() in the URI.js library prior to version 1.19.11. The parser does not strip ASCII tab or newline characters (\r, \n, \t) from the input string, allowing an attacker to smuggle these characters into the URL. This can cause the protocol extraction logic to misinterpret the intended scheme, as the library previously only stripped leading whitespace but not these control characters [1][3].
Exploitation
An attacker can craft a URL containing CR, LF, or TAB characters, such as ja\r\nva\tscript:alert(1). If a user or application using the vulnerable library processes this URL (e.g., by calling URI.parse()), the parser will strip the control characters and treat the input as javascript:alert(1). This bypasses any protocol validation that might have blocked the javascript: scheme, enabling a cross-site scripting (XSS) attack. No authentication is required, and the attack can be delivered through any vector that supplies user-controlled URLs to the library [3][4].
Impact
Successful exploitation leads to XSS, allowing an attacker to execute arbitrary JavaScript in the context of the victim's browser. This can result in theft of session cookies, credential harvesting, or other client-side attacks. The attack is performed with the privileges of the user running the application that uses URI.js [2][4].
Mitigation
Upgrade to URI.js version 1.19.11 or later, released on April 5, 2022, which introduces the URI.ascii_tab_whitespace regex and strips \r, \n, and \t characters from the input before parsing [3]. No workaround is available if the library is used for URL parsing. The vulnerability was disclosed via the huntr.dev bug bounty platform [4].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
urijsnpm | < 1.19.11 | 1.19.11 |
Affected products
2- medialize/medialize/uri.jsv5Range: unspecified
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-3vjf-82ff-p4r3ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-1243ghsaADVISORY
- github.com/medialize/uri.js/commit/b0c9796aa1a95a85f40924fb18b1e5da3dc8ffaeghsax_refsource_MISCWEB
- huntr.dev/bounties/8c5afc47-1553-4eba-a98e-024e4cc3dfb7ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.