CVE-2021-23354
JSON

5.3medium

Regular Expression Denial of Service (ReDoS)

Severity
5.3medium CVSS:3.1 by snyk
Exploit likelihood
2.18% (higher than 82% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
snyk
Also known as
GHSA-xfhp-gmh8-r8v2SNYK-JS-PRINTF-1072096

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.

Affected

Product or packageVersionsReported by
printffrom unspecified before 0.6.1CVE List
printf (npm)before 0.6.1GitHub Advisory Database
adaltas printfbefore 0.6.1NVD

All scores

snyk5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P

Classification

What each source says

CVE List

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.

GitHub Advisory Database

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.

NVD (es)

El paquete printf versiones anteriores a 0.6.1, es vulnerable a una Denegación de Servicio de Expresión Regular (ReDoS) por medio de la cadena de expresiones regulares /\%(?:\(([\w_.]+)\)|([1-9]\d*)\$)?([0+\ -\]*)(\* |\d+)?(\.)? (\*|\D+)? [HlL]?([\% BscdeEfFgGioOuxX])/g en la biblioteca lib/printf.js. La expresión regular vulnerable tiene una complejidad de tiempo en el peor de los casos cúbica

References

Sources

SourceRecordLicence
CVE ListCVE-2021-23354 changed 2024-09-17CVE Terms of Use
GitHub Advisory DatabaseGHSA-xfhp-gmh8-r8v2 changed 2026-07-08CC-BY-4.0
NVDCVE-2021-23354 changed 2026-06-17Public domain