Advisory

GHSA-xfhp-gmh8-r8v2

Also known as: CVE-2021-23354, SNYK-JS-PRINTF-1072096

Summary

printf vulnerable to Regular Expression Denial of Service (ReDoS)

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2021-03-19 21:22 UTC
Modified
2026-07-08 06:50 UTC

Affected packages and fixes

printf

npm · All systems

Affected

  • introduced 0, fixed 0.6.1 (semver)

Fixed versions

0.6.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences