GHSA-xfhp-gmh8-r8v2

Suggest an improvement
Source
https://github.com/advisories/GHSA-xfhp-gmh8-r8v2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/03/GHSA-xfhp-gmh8-r8v2/GHSA-xfhp-gmh8-r8v2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-xfhp-gmh8-r8v2
Aliases
Published
2021-03-19T21:22:10Z
Modified
2026-07-08T06:50:03.433452551Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
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.

Database specific
{
    "cwe_ids": [
        "CWE-400"
    ],
    "github_reviewed": true,
    "nvd_published_at": "2021-03-12T15:15:00Z",
    "severity": "HIGH",
    "github_reviewed_at": "2021-03-15T18:59:14Z"
}
References

Affected packages

npm / printf

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.6.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/03/GHSA-xfhp-gmh8-r8v2/GHSA-xfhp-gmh8-r8v2.json"