Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

toml-node: Uncontrolled resource consumption (CPU DoS) via unbounded-length integer literals in toml.parse()GHSA-9qmh-m7c6-f92p

HIGHFix: BinaryMuse/toml-node@9d52e38

GHSA-9qmh-m7c6-f92p is a high-severity (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in toml. A fix is available for toml — see the affected versions and patch details below.

Also known asCVE-2026-114144
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs26th percentile — riskier than 26% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

GHSA-9qmh-m7c6-f92p by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 394,415 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

1Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
tomlnpm
18.5Mdownloads / week

Description

Summary

toml.parse() converts integer literals (hex, octal, binary, and decimal) to BigInt without first bounding the length of the digit sequence. Since BigInt(string) construction from a very long numeric string runs in super-linear time, a single small, well-formed TOML document containing one long integer literal can pin a Node.js process's event loop at 100% CPU for several seconds — a denial of service for any application that parses attacker-supplied or third-party TOML. No authentication or complex crafting is required.

Details

In lib/parser.js, the grammar actions that build integer nodes call BigInt() directly on the matched digit text, with no upper bound on its length:

  • lib/parser.js:326 — hex: BigInt('0x' + stripUnderscores(digits))
  • lib/parser.js:327 — octal: BigInt('0o' + stripUnderscores(digits))
  • lib/parser.js:328 — binary: BigInt('0b' + stripUnderscores(digits))
  • lib/parser.js:329 — decimal: BigInt(stripUnderscores(text))

The parser does enforce a nesting-depth limit (MAX_DEPTH, default 500, lib/parser.js:4343) to guard against stack overflow from deeply nested arrays/inline tables (per GHSA-82x6-q7mm-w9cf). However, that guard only bounds structural nesting — it does not bound the length of a single scalar token.

The subsequent 64-bit range check in lib/compiler.js (reduceInteger, lines 143–150, comparing against INT64_MIN / INT64_MAX defined at lines 3–4) happens after the expensive BigInt() conversion has already completed. It therefore provides no protection against this cost — the CPU time is already spent by the time the value is rejected as out of range.

PoC

const toml = require('toml');

const N = 5_000_000; // ~5 MB request body
const doc = 'x = 0x' + 'f'.repeat(N);

const start = Date.now();
try {
  toml.parse(doc); // eventually throws "outside the 64-bit signed integer range" —
                    // but only after the costly conversion has run
} catch (e) {}

console.log('elapsed:', Date.now() - start, 'ms');

Measured results:

Digits (hex)Approx. payload sizeParse time
200,000~200 KB141 ms
400,000~400 KB276 ms
800,000~800 KB685 ms
1,600,000~1.6 MB1,761 ms
5,000,000~5 MB6,061 ms

Growth is clearly super-linear. The same behavior reproduces for plain decimal literals (3,000,000 '9' digits → ~6.3 s).

Impact

Any application that calls toml.parse() on untrusted or third-party input — config upload endpoints, CI/CD tools ingesting user-supplied .toml files, package managers, linters, editors/language servers — is exposed.

During the conversion, the event loop is fully blocked. In a typical single-threaded Node.js server this stalls all concurrent request handling, not just the request containing the malicious payload. A single ~5 MB request is sufficient to cause several seconds of full CPU denial of service.

Suggested fix: Reject digit sequences above a reasonable length before calling BigInt(), analogous to the existing maxDepth option. A 64-bit signed integer requires at most 20 decimal digits or 16 hex digits, so any digit sequence significantly longer than that is guaranteed to fail the existing range check anyway, and can be rejected with a cheap .length comparison instead of paying for the full BigInt conversion.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmtomlall versions5.0.1npm install toml@5.0.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for toml, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update toml to 5.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-9qmh-m7c6-f92p is resolved across your whole dependency graph.

  3. Workarounds

    Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.

Frequently Asked Questions

### Summary `toml.parse()` converts integer literals (hex, octal, binary, and decimal) to `BigInt` without first bounding the length of the digit sequence. Since `BigInt(string)` construction from a very long numeric string runs in super-linear time, a single small, well-formed TOML document containing one long integer literal can pin a Node.js process's event loop at 100% CPU for several seconds — a denial of service for any application that parses attacker-supplied or third-party TOML. No authentication or complex crafting is required. ### Details In `lib/parser.js`, the grammar actions tha
O3 Security · Impact-Aware SCA

Is GHSA-9qmh-m7c6-f92p in your dependencies?

Find it across npm, including transitive dependencies.

toml-node: Uncontrolled resource consumption (CPU…