CVE-2026-114141
toml-node: Quadratic-complexity DoS via many array-of-tables headers in toml.parse()
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.7
toml-node: Quadratic-complexity DoS via many array-of-tables headers in toml.parse()
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.
- Record
CVE-2026-114141- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-407
- Updated
- 2026-11-02
EUVDEUVD-2026-107552
8.7
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.
- Record
EUVD-2026-107552- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-4qx8-w7c3-pj3p
8.7
toml-node: Quadratic-complexity DoS via many array-of-tables headers in toml.parse()
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), repositoryBinaryMuse/toml-node - Function:
addTableArray()inlib/compiler.js - Confirmed present in the audited checkout at commit
1b2ac40(2026-07-16), one commit past thev5.0.0tag (a changelog-only change) — i.e. present inv5.0.0, the latest release. Not exhaustively verified against every prior release, but the affected function is unrelated tov5.0.0's BigInt/Temporal changes (perCHANGELOG.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):
| Variant | n | input size | time |
|---|---|---|---|
| N distinct-named [[name]] headers, no unrelated keys | 20,000 | 321 KB | 10.3 s |
| Same N with all-same-name headers (self-pruning, control) | 20,000 | 240 KB | 78 ms |
| M unrelated top-level keys + N same-name [[name]] headers | M=N=32,000 | 906 KB | 42.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…
- Record
GHSA-4qx8-w7c3-pj3p- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-407
- Updated
- 2026-11-02
NVD
8.7
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.
- Record
CVE-2026-114141- CVSS 4.0
- 8.7 High
CVSS:4.0/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 - Weakness
- CWE-407
- Updated
- 2026-11-02
OSV
8.7
toml-node: Quadratic-complexity DoS via many array-of-tables headers in toml.parse()
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.
- Record
CVE-2026-114141- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-407
- Updated
- 2026-11-02
OSVGHSA-4qx8-w7c3-pj3p
8.7
toml-node: Quadratic-complexity DoS via many array-of-tables headers in toml.parse()
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), repositoryBinaryMuse/toml-node - Function:
addTableArray()inlib/compiler.js - Confirmed present in the audited checkout at commit
1b2ac40(2026-07-16), one commit past thev5.0.0tag (a changelog-only change) — i.e. present inv5.0.0, the latest release. Not exhaustively verified against every prior release, but the affected function is unrelated tov5.0.0's BigInt/Temporal changes (perCHANGELOG.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):
| Variant | n | input size | time |
|---|---|---|---|
| N distinct-named [[name]] headers, no unrelated keys | 20,000 | 321 KB | 10.3 s |
| Same N with all-same-name headers (self-pruning, control) | 20,000 | 240 KB | 78 ms |
| M unrelated top-level keys + N same-name [[name]] headers | M=N=32,000 | 906 KB | 42.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…
- Record
GHSA-4qx8-w7c3-pj3p- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-407
- Updated
- 2026-11-02
OSVCLSA-2026-1793099957 No score
TuxCare security update for toml (2 CVEs)
TuxCare rebuilt toml to address 2 CVEs. Fixed in 3.0.0-tuxcare.2.
- Record
CLSA-2026-1793099957- Updated
- 2026-11-02
OSVCLSA-2026-1793099990 No score
TuxCare security update for toml (3 CVEs)
TuxCare rebuilt toml to address 3 CVEs. Fixed in 4.3.0-tuxcare.1.
- Record
CLSA-2026-1793099990- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2026-114141 No score
CVE-2026-114141 in toml - Patched by Root
Root has patched CVE-2026-114141 in the toml package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-114141- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
tomlnpm |
through 5.0.0 | 5.0.1 |
tomlTuxCare:npm From an advisory covering 2 CVEs |
3.0.0-tuxcare.0 up to 3.0.0-tuxcare.2, plus listed versions 3.0.03.0.0-tuxcare.1 |
3.0.0-tuxcare.2 |
tomlTuxCare:npm From an advisory covering 3 CVEs |
4.3.0-tuxcare.0 up to 4.3.0-tuxcare.1, plus listed versions 4.3.0 |
4.3.0-tuxcare.1 |
tomlnpm |
before 5.0.1 | 5.0.1 |
tomlRoot:npm |
before 3.0.0-aikido.2 | 3.0.0-aikido.24.2.0-aikido.1 |
@rootio/tomlRoot:npm |
before 3.0.0-root.io.2 | 3.0.0-root.io.24.2.0-root.io.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-114141 is a high vulnerability (CVSS 8.7) in Binarymuse Toml-node, published October 21, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.47%, the 41st percentile. Fixed in toml 5.0.1.
References
github.com/BinaryMuse/toml-node/security/advisories/GHSA-4qx8-w7c3-pj3p
github.com/BinaryMuse/toml-node/commit/609c873fffea0a27ebe5b4dd098eed2b3daf3606
github.com/BinaryMuse/toml-node/releases/tag/v5.0.1
nvd.nist.gov/vuln/detail/CVE-2026-114141
github.com/advisories/GHSA-4qx8-w7c3-pj3p
github.com/CVEProject/cvelistV5/tree/main/cves/2026/114xxx/CVE-2026-114141.json
github.com/BinaryMuse/toml-node
Left out here: the rest of 2 source descriptions. The JSON record has them.