Miggo Logo

CVE-2022-0613: Authorization Bypass Through User-Controlled Key in urijs

6.5

CVSS Score
3.1

Basic Information

EPSS Score
0.04239%
Published
2/17/2022
Updated
2/3/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
urijsnpm< 1.19.81.19.8

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*tt**k*r **n us* **s*-ins*nsitiv* proto*ol s***m*s lik* *TTP, *tTP, *Ttp *t*. in or**r to *yp*ss t** p*t** *or *V*-****-****.

Reasoning

T** vuln*r**ility st*ms *rom t** proto*ol norm*liz*tion *o** in URI.js's p*rsin* lo*i*. T** *ommit ******* s*ows t** *riti**l *ix w*s ***in* t** 'i' *l** to t** proto*ol-m*t**in* r***x p*tt*rn. ***or* t*is *ix, t** r***x '/^(*ttps?|*tp|wss?)?:[/\\]*/