CVE-2017-16098: Regular Expression Denial of Service in charset
7.5
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.55097%
CWE
Published
8/9/2018
Updated
3/31/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 |
---|---|---|---|
charset | npm | < 1.0.1 | 1.0.1 |
Vulnerability Intelligence
Miggo AI
Root 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.