Miggo Logo

CVE-2022-25927:
ReDoS Vulnerability in ua-parser-js version

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.7945%
Published
1/24/2023
Updated
6/21/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:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
ua-parser-jsnpm< 0.7.330.7.33
ua-parser-jsnpm>= 0.8.0, < 1.0.331.0.33

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The commit diff shows removal of the trailing whitespace regex in trim(), with the commit message explicitly stating it was vulnerable. The CVE description and Snyk PoC demonstrate how crafted long inputs to this function trigger ReDoS. The regex pattern /\s\s*$/ is known to be inefficient as it creates redundant backtracking possibilities (equivalent to \s+$ but with worse performance characteristics). The function's position before length truncation allowed attackers to bypass input size protections.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### **s*ription: * r**ul*r *xpr*ssion **ni*l o* s*rvi** (R**oS) vuln*r**ility **s ***n *is*ov*r** in `u*-p*rs*r-js`. ### Imp**t: T*is vuln*r**ility *yp*ss t** li*r*ry's `M*X_L*N*T*` input limit pr*v*ntion. *y *r**tin* * v*ry-v*ry-lon* us*r-***nt str

Reasoning

T** *ommit *i** s*ows r*mov*l o* t** tr*ilin* w*it*sp*** r***x in trim(), wit* t** *ommit m*ss*** *xpli*itly st*tin* it w*s vuln*r**l*. T** *V* **s*ription *n* Snyk Po* **monstr*t* *ow *r**t** lon* inputs to t*is *un*tion tri***r R**oS. T** r***x p*t