Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-23354

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-23354
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:40 UTC · Revision 1

Source evidence

CVE-2021-23354

core-osv · Original source

Published 12 Mar 2021, 15:15 UTC

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.

osv:CVE-2021-23354
Complete source record
{
  "id": "e2f38ba4dcd2fcf563ea6d2e816a2a157058fdcf293e8f64795126d098d11bb8",
  "url": "https://osv.dev/vulnerability/CVE-2021-23354",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-23354",
    "summary": "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.",
    "evidence": "osv:CVE-2021-23354",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-23354",
      "aliases": [
        "CVE-2021-23354",
        "GHSA-xfhp-gmh8-r8v2",
        "SNYK-JS-PRINTF-1072096"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/adaltas/node-printf",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "5d11e642922fe1a125a141d4becfee00f29c67ce"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:adaltas:printf:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.6.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.6.0",
            "v0.5.3",
            "v0.5.2",
            "v0.5.1",
            "v0.4.0",
            "v0.3.0",
            "v0.2.5",
            "v0.2.4",
            "v0.2.3",
            "v0.2.2",
            "0.2.1",
            "v0.2.0",
            "v0.1.3",
            "v0.1.2",
            "v0.1.1",
            "v0.1.0",
            "v0.0.7",
            "v0.0.6",
            "v0.0.4",
            "v0.0.3",
            "v0.0.2",
            "v0.0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-23354.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:32.134543871Z",
      "provider": "osv",
      "references": [
        "https://snyk.io/vuln/SNYK-JS-PRINTF-1072096",
        "https://github.com/adaltas/node-printf/issues/31",
        "https://github.com/adaltas/node-printf/pull/32"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-23354",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 385503,
  "published_at": "2021-03-12T15:15:14.207+00:00"
}