Vulnerabilities in pkg:npm/figlet

PACKAGE
Advisory Identifier: GHSA-62ch-8vmq-8xm7
Advisory Summary

CVE-2026-96780 is a HIGH denial of service vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Figlet libraries in the npm ecosystem. The issue involves figlet is vulnerable to denial of service via unbounded loop when whitespacebreak is used with a small width. Remediation is available by upgrading affected packages to version 1.11.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/figlet

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/figlet. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-62ch-8vmq-8xm7 CVE-2026-96780 HIGH figlet is vulnerable to denial of service via unbounded loop when whitespaceBreak is used with a small width

CVE-2026-96780 at a Glance

CVE Identifier CVE-2026-96780
GHSA Identifier GHSA-62ch-8vmq-8xm7
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Figlet
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-96780

To remediate this vulnerability, upgrade all affected Figlet dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

figlet fixed: 1.11.3
npm install figlet@1.11.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls figlet

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-96780, inspect your project dependencies using npm:

npm ls figlet

Analyze the terminal output to locate any version of Figlet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.11.3), your application is affected.

Note: The npm ls figlet command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Figlet, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact A denial-of-service (infinite loop) can occur in `text()` / `textSync()` when **both**: - `whitespaceBreak: true` is set, **and** - `width` is set smaller than the rendered width of a single FIGlet character. Under these conditions `breakWord()` could never find a valid break point, so the word-wrapping loop in `generateFigTextLines()` never terminated. This pins a CPU core and grows memory without bound, blocking the Node.js event loop. ### Severity Low or Medium. Triggering requires a non-default configuration (`whitespaceBreak: true`) and an attacker-controlled `width` value reaching `text()`/`textSync()`. This library is typically used with fixed options, where this is not reachable. Applications that pass an untrusted `width` together with `whitespaceBreak` on a request path are affected. ### Patches Fixed in **figlet 1.11.3**. `breakWord()` now always makes forward progress (emitting an over-wide character on its own line), and FIGlet header parsing now rejects invalid values (e.g. zero/negative height). ### Workarounds Do not expose `width` to untrusted input, or leave `whitespaceBreak` disabled (the default), or upgrade to 1.11.3.

CVE-2026-96780 Affected Figlet Versions

1 component(s)
Fixed Versions:
1.11.3
Product / Package Ecosystem Affected Versions Fixed Version
figlet
npm
< 1.11.3
1.11.3

References

Frequently Asked Questions

What is CVE-2026-96780?
CVE-2026-96780 is a security vulnerability in Figlet involving figlet is vulnerable to denial of service via unbounded loop when whitespaceBreak is used with a small width under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Figlet versions are affected?
Affected versions include releases prior to 1.11.3 across affected packages: figlet.
What version fixes CVE-2026-96780?
Upgrading to 1.11.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is figlet affected?
Yes, figlet is affected in releases prior to 1.11.3. Upgrade your dependency to 1.11.3 or later.
What CWE is associated with CVE-2026-96780?
CVE-2026-96780 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check npm dependencies for CVE-2026-96780?
Run the dependency tree command: 'npm ls figlet'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-62ch-8vmq-8xm7",
  "modified" : "2026-10-02T22:39:16Z",
  "published" : "2026-10-02T22:39:16Z",
  "aliases" : [ "CVE-2026-96780" ],
  "summary" : "figlet is vulnerable to denial of service via unbounded loop when whitespaceBreak is used with a small width",
  "details" : "### Impact\nA denial-of-service (infinite loop) can occur in `text()` / `textSync()` when\n**both**:\n- `whitespaceBreak: true` is set, **and**\n- `width` is set smaller than the rendered width of a single FIGlet character.\nUnder these conditions `breakWord()` could never find a valid break point, so the\nword-wrapping loop in `generateFigTextLines()` never terminated. This pins a CPU\ncore and grows memory without bound, blocking the Node.js event loop.\n\n### Severity\nLow or Medium. Triggering requires a non-default configuration (`whitespaceBreak: true`) and\nan attacker-controlled `width` value reaching `text()`/`textSync()`. This library is typically\nused with fixed options, where this is not\nreachable. Applications that pass an untrusted `width` together with\n`whitespaceBreak` on a request path are affected.\n\n### Patches\nFixed in **figlet 1.11.3**. `breakWord()` now always makes forward progress\n(emitting an over-wide character on its own line), and FIGlet header parsing now\nrejects invalid values (e.g. zero/negative height).\n\n### Workarounds\nDo not expose `width` to untrusted input, or leave `whitespaceBreak` disabled\n(the default), or upgrade to 1.11.3.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "figlet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.11.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/patorjk/figlet.js/security/advisories/GHSA-62ch-8vmq-8xm7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-96780"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/patorjk/figlet.js/pull/169"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/patorjk/figlet.js/commit/cb2839d0e53aeafbd361e9587abc72e49e41cbb3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/patorjk/figlet.js"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-02T22:39:16Z",
    "nvd_published_at" : "2026-10-01T21:17:26Z"
  }
}