# CVE-2021-23354: Regular Expression Denial of Service (ReDoS)

- Severity: Medium 5.3 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.18%, higher than 82% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-03-12T15:10:16.014Z
- Modified: 2026-07-08T06:50:03.433Z
- Also known as: GHSA-xfhp-gmh8-r8v2, SNYK-JS-PRINTF-1072096
- Weaknesses: CWE-400, CWE-1333
- Assigned by: snyk

## 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.

(As written by CVE List.)

## Affected

- printf: from unspecified before 0.6.1
- printf (npm): before 0.6.1
- adaltas printf: before 0.6.1

## Every score

- snyk: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:N/I:N/A:P`

## References

- <https://github.com/adaltas/node-printf/issues/31> (exploit, issue-tracking, third-party-advisory, web)
- <https://snyk.io/vuln/SNYK-JS-PRINTF-1072096> (broken-link, web)
- <https://github.com/adaltas/node-printf/pull/32> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-23354> (advisory)
- <https://github.com/adaltas/node-printf/commit/a8502e7c9b0b22555696a2d8ef67722086413a68> (web)

## Sources

- CVE List: [CVE-2021-23354](https://www.cve.org/CVERecord?id=CVE-2021-23354), CVE Terms of Use, modified 2024-09-17
- GitHub Advisory Database: [GHSA-xfhp-gmh8-r8v2](https://github.com/advisories/GHSA-xfhp-gmh8-r8v2), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-23354](https://nvd.nist.gov/vuln/detail/CVE-2021-23354), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-23354 · Whole record: https://cve.day/CVE-2021-23354.json · Rebuilt by cve.day 2026-11-25T22:58:00.274Z
