Miggo Logo

CVE-2017-16098: Regular Expression Denial of Service in charset

7.5

CVSS Score
3.0

Basic Information

EPSS Score
0.55097%
Published
8/9/2018
Updated
3/31/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
charsetnpm< 1.0.11.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the CHARTSET_RE regular expression in index.js, which was modified in the patch to add quantifier limits ({0,10} for spaces and {1,100} for charset strings). The original regex's unbounded quantifiers (\s* and *) made it susceptible to ReDoS via crafted long inputs. The charset function directly uses this regex for header parsing, making it the clear vulnerable entry point. The commit's test cases in performance.test.js explicitly validate these limits, confirming the function's role in the vulnerability.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*****t** v*rsions o* `***rs*t` *r* sus**pti*l* to * r**ul*r *xpr*ssion **ni*l o* s*rvi**. T** *mpli*i**tion on t*is vuln*r**ility is r*l*tiv*ly low - it t*k*s *roun* * s**on*s *or t** *n*in* to *x**ut* on * m*li*ious input w*i** is **,*** ***r**t*rs

Reasoning

T** vuln*r**ility st*ms *rom t** ***RTS*T_R* r**ul*r *xpr*ssion in in**x.js, w*i** w*s mo*i*i** in t** p*t** to *** qu*nti*i*r limits ({*,**} *or sp***s *n* {*,***} *or ***rs*t strin*s). T** ori*in*l r***x's un*oun*** qu*nti*i*rs (\s* *n* *) m*** it