Every CVE Search/ Get API key

CVE-2021-23354

Regular Expression Denial of Service (ReDoS)

5.3 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
Low

Exploit likelihood

2.18%Up 1.1 points since Apr 14, 2021
90%50%10%1%

What each source reports

CVE List Score used 5.3

Regular Expression Denial of Service (ReDoS)

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.

Record
CVE-2021-23354
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
EUVDEUVD-2021-0725 5.3

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.

Record
EUVD-2021-0725
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-03
GitHub AdvisoriesGHSA-xfhp-gmh8-r8v2 7.5

printf vulnerable to Regular Expression Denial of Service (ReDoS)

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.

Record
GHSA-xfhp-gmh8-r8v2
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
NVD 5.3

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.

Record
CVE-2021-23354
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-1333
Updated
2026-11-02
OSV 7.5

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.

Record
CVE-2021-23354
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVGHSA-xfhp-gmh8-r8v2 7.5

printf vulnerable to Regular Expression Denial of Service (ReDoS)

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.

Record
GHSA-xfhp-gmh8-r8v2
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
OSVCLSA-2026-1772669616 No score

TuxCare security update for printf (1 CVE)

TuxCare rebuilt printf to address 1 CVE. Fixed in 0.2.5-tuxcare.1.

Record
CLSA-2026-1772669616
Updated
2026-11-02
OSVCLSA-2026-1774311624 No score

TuxCare security update for printf (1 CVE)

TuxCare rebuilt printf to address 1 CVE. Fixed in 0.5.3-tuxcare.1.

Record
CLSA-2026-1774311624
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
printf
npm
before 0.6.1
0.6.1
printf
TuxCare:npm
0.2.5-tuxcare.0 up to 0.2.5-tuxcare.1, plus listed versions
0.2.5
0.2.5-tuxcare.1
printf
TuxCare:npm
0.5.3-tuxcare.0 up to 0.5.3-tuxcare.1, plus listed versions
0.5.3
0.5.3-tuxcare.1

History

History
RecordedChangedSources
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-23354 is a medium vulnerability (CVSS 5.3) in Adaltas Printf, published March 12, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.18%, the 82nd percentile. Fixed in printf 0.6.1.

References

MoveEnter Open