HighCVE-2026-114141

    toml-node: Quadratic-complexity DoS via many array-of-tables headers in toml.parse() (CVE-2026-114141)

    Published Last modified Sources: CVE.org, Hersteller

    What is affected, what to do

    Update BinaryMuse Toml-node to version 5.0.1.

    Affected
    • BinaryMuse Toml-node lt *..5.0.1
    Fixed in
    • BinaryMuse Toml-node 5.0.1

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    8.7

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: Vendor (CNA), CVSS v4

    8.7

    CVSS v4

    Severity High on the scale from 0 to 10.

    Source: CVE.org, Hersteller

    —

    EPSS score

    No value is available for this vulnerability.

    Show all metrics
    Severity
    High
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    73.50 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    no public PoC known
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    8.7 Methodology
    CVSS v4

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    8.7
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    —
    Published
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-407

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    High technical severity: assess and remediate the vulnerability in vulnerability handling under Art. 21(2)(e) NIS2 and document the decision.
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    Summary

    toml.parse() is vulnerable to a quadratic-complexity (O(n²)) denial-of-service via many array-of-tables ([[name]]) headers. addTableArray() in lib/compiler.js rescans two entire bookkeeping Sets on every [[name]] header without pruning unrelated or distinct entries, so a document containing n such headers costs O(n²) compiler work. A ~321KB document of 20,000 distinct-named [[name]] blocks takes ~10.3 seconds to parse — a completely ordinary-looking TOML shape (a flat settings block plus one or more array-of-tables sections), not a contrived edge case. This is a separate, unpatched code path from the previously fixed stack-overflow DoS (GHSA-82x6-q7mm-w9cf) and requires no key nesting or dotted keys at all.

    Affected component / version

    • Package: toml (npm), repository BinaryMuse/toml-node
    • Function: addTableArray() in lib/compiler.js
    • Confirmed present in the audited checkout at commit 1b2ac40 (2026-07-16), one commit past the v5.0.0 tag (a changelog-only change) — i.e. present in v5.0.0, the latest release. Not exhaustively verified against every prior release, but the affected function is unrelated to v5.0.0's BigInt/Temporal changes (per CHANGELOG.md), so the defect likely predates that release as well.

    Details

    toml.parse(input, options) (index.js:5-9) forwards the caller-supplied string to parser.parse() and then compiler.compile() with no length or structural validation. Every [[name]] (array-of-tables) header is routed (reduce(), lib/compiler.js:43) to addTableArray() (lib/compiler.js:218-245), which performs two full linear scans on every call:

    assignedPaths.forEach(function(p) {
      if (isSameOrSubPath(p, quotedPath)) assignedPaths.delete(p);
    });
    valueAssignments.forEach(function(p) {
      if (isSameOrSubPath(p, quotedPath)) valueAssignments.delete(p);
    });
    

    (lib/compiler.js:228-233)

    assignedPaths and valueAssignments accumulate one entry per top-level key/table/array path ever assigned in the entire document. Each scan prunes only entries matching the currently reopened path via isSameOrSubPath() (lib/compiler.js:319-321: path === prefix || path.indexOf(prefix + ".") === 0); anything else — an unrelated top-level key, or simply a different array-of-tables name — is never removed and is rescanned in full on every subsequent [[name]] header for the rest of the parse. Set.prototype.forEach has no early exit, so this is unconditionally O(current Set size) on every call, giving O(n²) total work for n such headers.

    Proof of Concept

    The sharpest reproduction needs no unrelated keys at all — just N array-of-tables headers with N distinct names, since nothing is ever pruned when no name repeats:

    const toml = require('toml');
    
    function distinctArrayHeaders(n) {
      let out = '';
      for (let i = 0; i < n; i++) out += `[[a${i}]]\nv = 1\n`;
      return out;
    }
    
    // ~321 KB input -- takes ~10.3 seconds
    toml.parse(distinctArrayHeaders(20000));
    

    Measured timings (Node, direct execution against this repo):

    Variantninput sizetime
    N distinct-named [[name]] headers, no unrelated keys20,000321 KB10.3 s
    Same N with all-same-name headers (self-pruning, control)20,000240 KB78 ms
    M unrelated top-level keys + N same-name [[name]] headersM=N=32,000906 KB42.3 s

    The ~130x gap between the distinct-name and same-name cases at identical N and comparable input size isolates the mechanism precisely: the bug is unbounded Set growth from never-pruned entries, not string length or any other confound. A product-law check (varying M and N independently in the mixed variant) further confirmed genuine O(M·N) complexity.

    Impact

    Node.js is single-threaded — this synchronous, multi-second-to-tens-of-seconds compile blocks the entire process event loop, standard uncontested Node.js behavior. The triggering document shape — flat top-level config keys plus one or more array-of-tables sections (e.g. a [db] settings block plus a [[servers]] list) — is unremarkable, common real-world TOML, not an edge case. No authentication or special access is required; only the ability to get one TOML string parsed by an application using this library.

    Suggested remediation

    Avoid scanning the entire assignedPaths/valueAssignments Sets on every [[name]] header. Index entries by their top-level path segment (e.g. a Map<string, Set<string>> keyed by the first key component) so addTableArray() only ever scans the bucket relevant to the path being reopened, in time proportional to that bucket's size rather than the whole document's accumulated path count:

    var assignedByRoot = new Map(); // root segment -> Set<fullPath>
    
    function addTableArray(node) {
      var path = node.value;
      var root = path[0];
      var bucket = assignedByRoot.get(root) || new Set();
      bucket.forEach(function(p) {
        if (isSameOrSubPath(p, quotedPath)) bucket.delete(p);
      });
      // ...rest of addTableArray unchanged, reading/writing the per-root bucket
      // instead of the global assignedPaths/valueAssignments Sets
    }
    

    As with the sibling finding, an input-size or table-count limit would also help as defense-in-depth.

    Credit

    Discovered and reported by SecDim Security Research secdim.com | @secdim | security@secdim.com

    Source: NVD (NIST), cvelistv5, GitHub Security Advisories

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    VendorProductAffected versionsFixed in
    BinaryMusetoml-node
    • < 5.0.1
    • 5.0.1
    npmtoml
    • <= 5.0.0
    • 5.0.1

    Weakness classes (CWE)

    • CWE-407Inefficient Algorithmic Complexity

      Class

      An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.

      Entry at MITRE CWE-407

    References & sources

    • github.comBinaryMuse/toml-node/security/advisories/GHSA-4qx8-w7c3-pj3px_refsource_CONFIRM
    • github.comBinaryMuse/toml-node/commit/609c873fffea0a27ebe5b4dd098eed2b3da…x_refsource_MISC
    • github.comBinaryMuse/toml-node/releases/tag/v5.0.1x_refsource_MISC

    Reanalysis & status changes

    Chronological NVD audit events for this CVE — reanalyses, CVSS updates, CPE diffs.

    1. New CVE Receivedsecurity-advisories@github.com

      • Description: after toml-node is a TOML parser for Node.js and the browser. Prior to 5.0.1, the toml.parse() compiler's addTableArray() function in lib/compiler.js rescans the complete assignedPaths and valueAssignments bookkeeping sets for every array-of-tables header. Distinct [[name]] paths are not pruned, so a document with many such headers causes quadratic synchronous work and can block the Node.js event loop, denying service to other operations in the process. This issue is fixed in version 5.0.1.
      • CVSS V4.0: after AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
      • CWE: after CWE-407
      • Affected: after New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/114xxx/CVE-2026-114141.json">CVE-2026-114141</a>
    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2026-114141
    <a href="https://intel.neosec.eu/en/cve/CVE-2026-114141"><img src="https://intel.neosec.eu/badge/cve/CVE-2026-114141.svg?lang=en" alt="CVE-2026-114141 – NEOSEC Intel" height="20"></a>