CVE-2021-23354 json
Regular Expression Denial of Service (ReDoS)
published 5y ago modified 4mo ago also GHSA-xfhp-gmh8-r8v2 , EUVD-2021-0725
- cvss
- 5.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.2%
- EPSS 2.2% chance of exploitation in 30 days, percentile 82%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- npm printf 0.6.1
- n/a printf 0.6.1
- github.com/adaltas/node-printf@a8502e7 commit
- github.com/adaltas/node-printf#32 pull request
Is CVE-2021-23354 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerExploit prediction
2.18% chance of exploitation in the next 30 days, higher than 82% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- github.com https://github.com/adaltas/node-printf/issues/31 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | printf | <0.6.1 |
0.6.1 |
Affected products
- n/a printf
Classification
References
-
github.com
/adaltas/node-printf/pull/32
web, patch, third-party-advisory
-
github.com
/adaltas/node-printf/commit/a8502e7c9b0b22555696a2d8ef67722086413a68
web
-
github.com
/adaltas/node-printf/issues/31
web, exploit, issue-tracking, third-party-advisory
-
snyk.io
/vuln/SNYK-JS-PRINTF-1072096
web, broken-link
-
nvd.nist.gov
/vuln/detail/CVE-2021-23354
advisory
Sources
- CVE List CVE-2021-23354
- GitHub Advisory GHSA-xfhp-gmh8-r8v2
- NVD CVE-2021-23354
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.