Vulnerability · Published Mar 12, 2021 · Assigned by snyk
CVE-2021-23354Regular Expression Denial of Service (ReDoS)
Medium 5.3
In plain English
A medium-severity security flaw in printf. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.2% (higher than 82% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)2.2%top 17.6% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known
Official description
The package printf before 0.6.1 are vulnerable to Regular Expression Denial of Service (ReDoS) via the regex string /\%(?:\(([\w_.]+)\)|([1-9]\d*)\$)?([0 +\-\]*)(\*|\d+)?(\.)?(\*|\d+)?[hlL]?([\%bscdeEfFgGioOuxX])/g in lib/printf.js. The vulnerable regular expression has cubic worst-case time complexity.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | printf | 0.6.1 | GHSA-xfhp-gmh8-r8v2 |
Affected products (as reported)
References
- https://snyk.io/vuln/SNYK-JS-PRINTF-1072096 x_refsource_MISC
- https://github.com/adaltas/node-printf/pull/32 x_refsource_MISC
- https://github.com/adaltas/node-printf/issues/31 x_refsource_MISC