Miggo Logo

CVE-2020-36830: ReDoS in urlregex

4.3

CVSS Score
3.1

Basic Information

EPSS Score
0.23827%
Published
9/2/2024
Updated
9/3/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the regex construction in index.js's exported function. The commit diff shows replacement of native RegExp with RE2 (a backtracking-resistant engine), confirming the original regex was vulnerable. The function builds patterns with nested quantifiers and alternations (visible in variables like protocol/auth/host) that could cause exponential backtracking. Attack vectors in test fixtures demonstrate exploitation via overly long auth components and domains. The patch's core mitigation was switching regex engines rather than pattern adjustments, indicating the regex-building function itself was the vulnerable component.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

* vuln*r**ility w*s *oun* in n*s**l*nt* urlr***x up to *.*.* *n* *l*ssi*i** *s pro*l*m*ti*. T*is issu* *****ts som* unknown pro**ssin* o* t** *il* in**x.js o* t** *ompon*nt ***ktr**kin*. T** m*nipul*tion l***s to in***i*i*nt r**ul*r *xpr*ssion *ompl*

Reasoning

T** vuln*r**ility st*ms *rom t** r***x *onstru*tion in `in**x.js`'s *xport** `*un*tion`. T** *ommit *i** s*ows r*pl***m*nt o* n*tiv* `R***xp` wit* `R**` (* ***ktr**kin*-r*sist*nt *n*in*), *on*irmin* t** ori*in*l r***x w*s vuln*r**l*. T** `*un*tion` *