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 package | Versions | Reported by |
|---|---|---|
| printf | from unspecified before 0.6.1 | CVE List |
| printf (npm) | before 0.6.1 | GitHub Advisory Database |
| adaltas printf | before 0.6.1 | NVD |
All scores
| snyk | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV: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
| 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://github.com/adaltas/node-printf/issues/31 | exploit, issue-tracking, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-23354 | advisory | |
| https://github.com/adaltas/node-printf/commit/a8502e7c9b0b22555696a2d8ef67722086413a68 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-23354 changed 2024-09-17 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-xfhp-gmh8-r8v2 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-23354 changed 2026-06-17 | Public domain |