CVE-2022-0613: Authorization Bypass Through User-Controlled Key in urijs
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.04239%
CWE
Published
2/17/2022
Updated
2/3/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
urijs | npm | < 1.19.8 | 1.19.8 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the protocol normalization code in URI.js's parsing logic. The commit 6ea641c shows the critical fix was adding the 'i' flag to the protocol-matching regex pattern. Before this fix, the regex '/^(https?|ftp|wss?)?:[/\]*/' was case-sensitive, meaning mixed-case schemes wouldn't be properly normalized to lowercase. This allowed bypassing checks that relied on protocol casing (e.g., blocking 'http:' but not 'hTtP:'). The test case added in test/urls.js with 'hTTps://////attacker.com' demonstrates this attack vector. The vulnerable code path is in the URI parser's initial protocol handling stage.