Description
js-toml is a TOML parser for JavaScript, fully compliant with the TOML 1.0.0 Spec. Versions up to and including 1.1.1 parse hexadecimal / octal / binary integer literals via a hand-written `parseBigInt` loop that multiplies a `BigInt` accumulator by the radix once per input digit. Each iteration performs a `BigInt * BigInt` operation on an accumulator that grows linearly with the number of digits already consumed, so the whole loop is O(n²) in the literal length. The lexer regex places no upper bound on the literal length, so a single TOML document containing one ~500 kB hex literal pins one CPU core for ~40 seconds on a modern laptop (Apple M-series, Node v22). Memory amplification is bounded but CPU amplification is severe and grows quadratically: doubling the literal length quadruples the work. A caller that invokes `load()` on attacker-controlled TOML (configuration upload endpoints, CI/CD systems ingesting third-party `*.toml`, IDE plugins, build tools) is exposed to a single-request CPU exhaustion DoS. Version 1.1.2 fixes the issue.
Published: 2026-06-19
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service via CPU exhaustion
Action: Patch immediately
AI Analysis

Impact

js‑toml uses a hand‑written parseBigInt loop that multiplies a BigInt accumulator by the radix for each input digit. Each multiplication grows with the size of the accumulator, so the total cost is quadratic in the literal length. The lexer regex imposes no upper bound on literal length, allowing an attacker to supply a very long hexadecimal, octal or binary literal that forces the parser to perform an enormous number of BigInt multiplications. A single request containing such a literal can tie a CPU core for dozens of seconds, effectively bringing a Node.js process to a halt. This uncontrolled CPU consumption results in a denial‑of‑service attack.

Affected Systems

The affected product is the js‑toml TOML parser library maintained by sunnyadn. Versions up to and including 1.1.1 are vulnerable; version 1.1.2 contains the fix. Any JavaScript runtime that loads vulnerable toml via the library’s load() function—such as configuration upload endpoints, CI/CD pipelines, IDE plugins, build tools or services that ingest third‑party *.toml files—may be exposed to this CPU‑exhaustion denial‑of‑service attack.

Risk and Exploitability

The vulnerability has a CVSS score of 7.5, indicating high severity. EPSS is < 1%, and the flaw is not listed in the CISA KEV catalog. The most likely attack vector is remote, where an attacker can supply malicious TOML payloads to a service that uses js‑toml. Because a single crafted request can trigger the denial‑of‑service, an adversary with network access to a vulnerable service can easily exhaust CPU resources. The impact is limited to availability and can be mitigated by updating the library. When that is not possible, the attacker can still exploit the quadratic cost by sending large literals.

Generated by OpenCVE AI on November 4, 2026 at 15:10 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade js‑toml to version 1.1.2 or later.
  • Implement size limits on TOML files before parsing to prevent extremely long integer literals.
  • Monitor CPU usage of services using js‑toml and throttle or block requests when anomalous usage spikes.

Generated by OpenCVE AI on November 4, 2026 at 15:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-wp3c-266w-4qfq js-toml vulnerable to CPU exhaustion via O(n^2) BigInt construction on radix-prefixed integer literals
History

Wed, 04 Nov 2026 04:30:00 +0000


Wed, 04 Nov 2026 03:45:00 +0000

Type Values Removed Values Added
Description js-toml is a TOML parser for JavaScript, fully compliant with the TOML 1.0.0 Spec. Versions up to and including 1.1.0 parse hexadecimal / octal / binary integer literals via a hand-written `parseBigInt` loop that multiplies a `BigInt` accumulator by the radix once per input digit. Each iteration performs a `BigInt * BigInt` operation on an accumulator that grows linearly with the number of digits already consumed, so the whole loop is O(n²) in the literal length. The lexer regex places no upper bound on the literal length, so a single TOML document containing one ~500 kB hex literal pins one CPU core for ~40 seconds on a modern laptop (Apple M-series, Node v22). Memory amplification is bounded but CPU amplification is severe and grows quadratically: doubling the literal length quadruples the work. A caller that invokes `load()` on attacker-controlled TOML (configuration upload endpoints, CI/CD systems ingesting third-party `*.toml`, IDE plugins, build tools) is exposed to a single-request CPU exhaustion DoS. Version 1.1.1 fixes the issue. js-toml is a TOML parser for JavaScript, fully compliant with the TOML 1.0.0 Spec. Versions up to and including 1.1.1 parse hexadecimal / octal / binary integer literals via a hand-written `parseBigInt` loop that multiplies a `BigInt` accumulator by the radix once per input digit. Each iteration performs a `BigInt * BigInt` operation on an accumulator that grows linearly with the number of digits already consumed, so the whole loop is O(n²) in the literal length. The lexer regex places no upper bound on the literal length, so a single TOML document containing one ~500 kB hex literal pins one CPU core for ~40 seconds on a modern laptop (Apple M-series, Node v22). Memory amplification is bounded but CPU amplification is severe and grows quadratically: doubling the literal length quadruples the work. A caller that invokes `load()` on attacker-controlled TOML (configuration upload endpoints, CI/CD systems ingesting third-party `*.toml`, IDE plugins, build tools) is exposed to a single-request CPU exhaustion DoS. Version 1.1.2 fixes the issue.
References

Mon, 22 Jun 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 19 Jun 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Sunnyadn
Sunnyadn js-toml
Vendors & Products Sunnyadn
Sunnyadn js-toml

Fri, 19 Jun 2026 18:45:00 +0000

Type Values Removed Values Added
Description js-toml is a TOML parser for JavaScript, fully compliant with the TOML 1.0.0 Spec. Versions up to and including 1.1.0 parse hexadecimal / octal / binary integer literals via a hand-written `parseBigInt` loop that multiplies a `BigInt` accumulator by the radix once per input digit. Each iteration performs a `BigInt * BigInt` operation on an accumulator that grows linearly with the number of digits already consumed, so the whole loop is O(n²) in the literal length. The lexer regex places no upper bound on the literal length, so a single TOML document containing one ~500 kB hex literal pins one CPU core for ~40 seconds on a modern laptop (Apple M-series, Node v22). Memory amplification is bounded but CPU amplification is severe and grows quadratically: doubling the literal length quadruples the work. A caller that invokes `load()` on attacker-controlled TOML (configuration upload endpoints, CI/CD systems ingesting third-party `*.toml`, IDE plugins, build tools) is exposed to a single-request CPU exhaustion DoS. Version 1.1.1 fixes the issue.
Title CPU exhaustion via O(n^2) BigInt construction on radix-prefixed integer literals
Weaknesses CWE-1333
CWE-400
CWE-407
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}


Subscriptions

Sunnyadn Js-toml
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-11-04T03:42:15.699Z

Reserved: 2026-05-28T20:07:58.862Z

Link: CVE-2026-49293

cve-icon Vulnrichment

Updated: 2026-06-22T14:10:04.966Z

cve-icon NVD

Status : Modified

Published: 2026-06-19T19:16:36.297

Modified: 2026-11-04T04:17:37.027

Link: CVE-2026-49293

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-11-04T15:15:15Z

Weaknesses
  • CWE-1333

    Inefficient Regular Expression Complexity

  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-407

    Inefficient Algorithmic Complexity