What’s Vulnerable › Vulnerabilities
CVE-2021-23354: Regular Expression Denial of Service (ReDoS)
- Severity: high (CVSS 7.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 2.2% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2021-03-12 · updated 2026-06-17
- Weakness: CWE-1333
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 products
- printf: before 0.6.1 — fixed in 0.6.1
How to fix
Upgrade to a fixed version: printf 0.6.1. Check the vendor advisory for mitigations.
References
- https://github.com/adaltas/node-printf/issues/31
- https://github.com/adaltas/node-printf/pull/32
- https://snyk.io/vuln/SNYK-JS-PRINTF-1072096
- https://github.com/adaltas/node-printf/issues/31
- https://github.com/adaltas/node-printf/pull/32
- https://snyk.io/vuln/SNYK-JS-PRINTF-1072096
Get alerted when CVE-2021-23354 or the next vulnerability affects your stack