CVE-2021-3804: Inefficient Regular Expression Complexity in taro
7.5
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.48034%
CWE
Published
9/20/2021
Updated
3/29/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
@tarojs/helper | npm | < 3.3.9 | 3.3.9 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the REG_URL
regular expression constant in constants.ts
, as shown in the commit diff. The patch specifically modifies this regex to address ReDoS concerns by tightening the pattern for domain name validation (e.g., adding length constraints and removing ambiguous character ranges). Since this regex is used for URL validation, its inefficient patterns directly enabled the ReDoS vulnerability. The high confidence comes from the direct correlation between the CWE description, the commit message explicitly mentioning URL validation fixes, and the regex being the only modified code element in the security patch.