Vulnerability · Published Mar 12, 2021 · Assigned by snyk

CVE-2021-23354Regular Expression Denial of Service (ReDoS)

Medium 5.3

In plain English

A medium-severity security flaw in printf. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.2% (higher than 82% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)2.2%top 17.6% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
npmprintf0.6.1GHSA-xfhp-gmh8-r8v2

Affected products (as reported)

VendorProductVersions
n/a printf unspecified – before 0.6.1

References