All reports
High

printf vulnerable to Regular Expression Denial of Service (ReDoS)

Affected versions

Affected versions
< 0.6.1
Fixed version
0.6.1

Exploitation

CVE-2021-23354

Probability of exploitation in the next 30 days: 2.18%

FIRST EPSS · 2026-11-19

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.

Links