CVE-2020-36830: ReDoS in urlregex
4.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.23827%
CWE
Published
9/2/2024
Updated
9/3/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
urlregex | npm | < 0.5.1 | 0.5.1 |
Vulnerability Intelligence
Miggo AI
Root 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.