HIGH 7.5

CVE-2026-49293: js-toml TOML Parser CPU Exhaustion DoS (v1.1.0 and earlier)

js-toml is a JavaScript library that parses TOML configuration files. Versions up to 1.1.0 contain a performance flaw that allows attackers to freeze your application by submitting specially crafted TOML files with very large hexadecimal, octal, or binary numbers. A malicious actor could submit a ~500 KB hex number that would pin your CPU for roughly 40 seconds—enough to cause a denial of service. Any system accepting TOML uploads or parsing untrusted TOML is at risk.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-1333, CWE-400, CWE-407
Affected products
1 configuration(s)
Published / Modified
2026-06-19 / 2026-06-26

NVD description (verbatim)

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.

4 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from a hand-written `parseBigInt` loop in the lexer that processes integer literals in different bases. For each digit consumed, the parser multiplies a BigInt accumulator by the radix, and because BigInt multiplication cost grows with operand size, the total work is O(n²) relative to the number of digits. The lexer regex imposes no length limit on numeric literals, allowing attackers to craft documents with arbitrarily large hex/octal/binary integers. Testing shows a ~500 KB hexadecimal literal consumes ~40 seconds of CPU on modern hardware (M-series Apple machines, Node.js v22). The quadratic amplification means doubling input length quadruples execution time, making this a severe CPU exhaustion vector.

Business impact

Applications that accept TOML from untrusted sources face single-request denial of service. This threatens configuration management systems, CI/CD pipelines that ingest third-party TOML files, IDE plugins parsing user-supplied configs, and build tools. An attacker needs only to submit or commit one malicious TOML file to exhaust a worker process, potentially disrupting deployments, blocking builds, or overloading shared infrastructure. The low barrier to exploitation—no authentication required, no user interaction—makes this a practical attack.

Affected systems

The js-toml library (sunnyadn/js-toml), versions up to and including 1.1.0, is affected. Any JavaScript/Node.js application using this library to parse untrusted TOML is vulnerable. Specifically at risk: web services with TOML config upload endpoints, CI/CD systems that consume TOML from dependencies or pull requests, development tools that parse TOML specifications, and any build or automation framework relying on js-toml.

Exploitability

Exploitability is very high. The attack requires no authentication, no special privileges, and no user interaction—only the ability to submit or influence a TOML document that the target application will parse. The malicious payload is trivial to craft (a long hex number), making weaponization straightforward. Any publicly exposed TOML parsing endpoint or any CI/CD system that auto-ingests third-party TOML is immediately vulnerable.

Remediation

Upgrade js-toml to version 1.1.1 or later, which replaces the vulnerable loop with an efficient algorithm. For applications unable to upgrade immediately, consider implementing a timeout on TOML parsing operations or validating numeric literal length before parsing. If feasible, restrict TOML uploads to authenticated users or pre-approved sources.

Patch guidance

Update the js-toml dependency to version 1.1.1 as specified by the vendor. Verify the fix by checking the package version in your package.json and running `npm list js-toml` (or equivalent for your package manager). Test your TOML parsing workflows after upgrade to ensure no regressions. If using a bundler or monorepo, confirm all transitive dependencies on js-toml receive the update.

Detection guidance

Monitor for sudden CPU spikes during TOML parsing, especially if correlated with uploads or configuration ingestion events. Review logs for large TOML files or unusual numeric literals. In CI/CD environments, flag builds that trigger unexpected CPU exhaustion. Network-level detection is difficult since the payload is valid TOML syntax; focus on runtime behavior (CPU usage, response time) and application logging around parse operations.

Why prioritize this

This vulnerability merits urgent patching due to its high CVSS score (7.5), low attack complexity, and the ease with which untrusted TOML sources are encountered in modern development workflows. The quadratic CPU amplification makes it a potent denial of service weapon, and many organizations use TOML in configuration management and CI/CD without strict input validation. Businesses that cannot immediately patch should implement temporary controls (timeouts, rate limiting) to reduce exposure.

Risk score, explained

The CVSS 3.1 score of 7.5 (HIGH) reflects a network-accessible vulnerability with no authentication required and high availability impact. Although there is no confidentiality or integrity breach, the ability to remotely exhaust CPU resources on a single request justifies the elevated score. The quadratic nature of the attack amplification—not fully captured by CVSS—makes real-world impact potentially more severe than the numeric score suggests.

Frequently asked questions

Can this be exploited remotely without authentication?

Yes. If your application exposes a TOML parsing endpoint (configuration upload, API that accepts TOML payloads), an attacker can submit a malicious TOML file from the internet without credentials. CI/CD systems that automatically parse TOML from pull requests or dependencies are similarly at risk.

Does upgrading to 1.1.1 fully resolve the issue?

Yes. Version 1.1.1 replaces the vulnerable hand-written loop with an efficient algorithm, eliminating the quadratic behavior. After upgrade and testing, the vulnerability is resolved.

If we cannot upgrade immediately, what should we do?

Implement a timeout on TOML parsing operations (e.g., 5–10 seconds) to prevent indefinite hangs. Restrict TOML uploads to authenticated users or pre-approved sources if possible. Monitor CPU usage during parsing and alert on anomalies. These mitigations reduce but do not eliminate risk; prioritize upgrading.

How would an attacker craft the malicious TOML?

The attacker simply includes a very large hexadecimal, octal, or binary integer literal in the TOML file—for example, a line like `large_number = 0x111...111` with hundreds of thousands of digits. The TOML syntax is valid, but parsing it triggers the quadratic CPU loop.

This analysis is provided for informational purposes only. Security assessments and patching decisions should account for your organization's specific risk tolerance, asset inventory, and operational constraints. Always verify patch availability and compatibility in your environment before deploying updates. SEC.co does not warrant the accuracy or completeness of this guidance and assumes no liability for decisions made in reliance on it. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).