GitHub Advisoryadvisory · npm
GHSA-xfhp-gmh8-r8v2 printf vulnerable to Regular Expression Denial of Service (ReDoS)
HIGH
Official page ↗
- Aliases
- CVE-2021-23354
- Ecosystem
- npm
- Packages
- printf
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses
- CWE-400
- Reviewed
- 2021-03-15
Affected packages
• npm printf: < 0.6.1 → fixed in 0.6.1
Description
The package printf before 0.6.1 are vulnerable to Regular Expression Denial of Service (ReDoS) via the regex string
```regex
/\%(?:\(([\w_.]+)\)|([1-9]\d*)\$)?([0 +\-\]*)(\*|\d+)?(\.)?(\*|\d+)?[hlL]?([\%bscdeEfFgGioOuxX])/g
```
in `lib/printf.js`. The vulnerable regular expression has cubic worst-case time complexity.
Related
Alias · CVE (1)
- CVE-2021-23354 The package printf before 0.6.1 are vulnerable to Regular Expression Denial of Service (ReDoS) via the regex string… vulnerability
Weakness · CWE (1)
- CWE-400 Uncontrolled Resource Consumption weakness