Miggo Logo

CVE-2021-29060: Regular Expression Denial of Service (ReDOS)

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.55871%
Published
6/22/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
color-stringnpm< 1.5.51.5.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability was explicitly traced to the hwb parsing regex in cs.get.hwb function as shown in the commit diff. The original regex pattern ([+-]?\d*[.]?\d+) allowed exponential backtracking due to ambiguous quantifiers. The patch replaced \d* with \d{0,3} to limit backtracking potential. Multiple sources (CVE description, commit diff, PoC) confirm this function as the attack vector.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

In t** npm p**k*** `*olor-strin*`, t**r* is * R**os (R**ul*r *xpr*ssion **ni*l o* S*rvi**) vuln*r**ility r***r*in* *n *xpon*nti*l tim* *ompl*xity *or lin**rly in*r**sin* input l*n*t*s *or `*w*()` *olor strin*s. Strin*s r****in* mor* t**n **** ***r*

Reasoning

T** vuln*r**ility w*s *xpli*itly tr**** to t** *w* p*rsin* r***x in *s.**t.*w* *un*tion *s s*own in t** *ommit *i**. T** ori*in*l r***x p*tt*rn ([+-]?\**[.]?\*+) *llow** *xpon*nti*l ***ktr**kin* *u* to *m*i*uous qu*nti*i*rs. T** p*t** r*pl**** \** wi