Miggo Logo

CVE-2021-23368: Regular Expression Denial of Service in postcss

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.52916%
Published
5/10/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
postcssnpm>= 7.0.0, < 7.0.367.0.36
postcssnpm>= 8.0.0, < 8.2.108.2.10

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from insecure regex patterns in source map parsing functions. Commit diffs show fixes to these regexes (removing \s* and adding negative lookaheads). The Snyk PoC demonstrates ReDoS via sourceMappingURL parsing, directly implicating these functions. Both functions handled source map annotation extraction with patterns vulnerable to catastrophic backtracking.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T** npm p**k*** `post*ss` *rom *.*.* *n* ***or* v*rsions *.*.** *n* *.*.** is vuln*r**l* to R**ul*r *xpr*ssion **ni*l o* S*rvi** (R**oS) *urin* sour** m*p p*rsin*.

Reasoning

T** vuln*r**ility st*ms *rom ins**ur* r***x p*tt*rns in sour** m*p p*rsin* *un*tions. *ommit *i**s s*ow *ix*s to t**s* r***x*s (r*movin* \s* *n* ***in* n***tiv* look*****s). T** Snyk Po* **monstr*t*s R**oS vi* sour**M*ppin*URL p*rsin*, *ir**tly impli