{"vuln_id":"GHSA-3g82-77xr-68x5","aliases":["CVE-2026-63386"],"description":"js-toml allows uncontrolled recursion in `load()` leading `RangeError` (stack exhaustion) on deeply nested input","published_at":"2026-11-20T14:40:45Z","modified_at":"2026-11-20T14:45:04.348534Z","first_seen_at":"2026-11-21T19:15:19.296889Z","severity":"medium","severity_source":"ghsa","cvss_score":5.3,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","cwe":["CWE-400","CWE-674"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-3g82-77xr-68x5"},"matched_alias":null,"items":[{"id":10877,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-3g82-77xr-68x5: js-toml allows uncontrolled recursion in `load()` leading `RangeError` (stack exhaustion) on deeply nested input","summary":"js-toml allows uncontrolled recursion in `load()` leading `RangeError` (stack exhaustion) on deeply nested input\n\n## Summary\n\n`load()` parses untrusted TOML using a recursive-descent parser (Chevrotain) and a\nrecursive tree-walking interpreter. Neither the parser nor the interpreter enforces a\nmaximum nesting / key depth. A small, attacker-controlled document with deep nesting\n(arrays, inline tables) or a long dotted key drives recursion past the V8 call-stack\nlimit, and `load()` throws an **uncaught `RangeError: Maximum call stack size exceeded`**.\n\nThis is a problem for two reasons:\n\n1. **Denial of Service.** A tiny payload (≈2 KB) reliably aborts parsing. In any\n   service that parses user-supplied TOML, an unhandled `RangeError` can crash the\n   worker/process (500 / restart loop).\n2. **Error-contract violation.** The library signals invalid input via\n   `SyntaxParseError` (see `src/load/exception.ts`; the entire test suite asserts\n   `SyntaxParseError`). Consumers that follow this contract —\n\n   ```js\n   try { load(input); }\n   catch (e) {\n     if (e instanceof SyntaxParseError) return badRequest();\n     throw e; // unexpected -> propagates\n   }\n   ```\n\n   — will **re-throw** the `RangeError` instead of treating the input as malformed,\n   turning malformed input into an unexpected fatal error.\n\n## Impact\n\n- Unauthenticated attacker who can supply a TOML string to an application using\n  `js-toml` can force `load()` to throw a non-`SyntaxParseError` error.\n- If the error is not caught by a generic handler, the Node.js process terminates\n  (availability impact).\n- Even when caught generically, the documented/expected error type contract is broken,\n  which can bypass input-validation branches that key off `SyntaxParseError`.\n\nNo confidentiality or integrity impact. The error is thrown synchronously and is\ncatchable, so a consumer that catches *all* exceptions is not crashed — this is why the\nseverity is assessed Low–Medium rather than High.\n\n## Affected code / root cause\n\nThere is no depth bound anywhere in the parse pipeline. Recursion occurs in (at least)\ntwo independent places:\n\n1. **Parser (recursive descent).** `src/load/parser.ts` — `array` / `inlineTable`\n   rules recurse through `value` for each nesting level.\n2. **Interpreter (tree walk).** `src/load/interpreter.ts` —\n   `assignValue`, `createTable`, `getOrCreateArray` recurse per dotted-key segment, and\n   `cleanInternalProperties` recurses per object depth.\n\nBecause there is no configurable or hard limit, the recursion depth is bounded only by\nthe V8 stack, and overflow surfaces as a raw `RangeError`.\n\n## Steps to reproduce (PoC)\n\nEnvironment used: Node.js v20, `js-toml@1.1.2`.\n\n```js\nimport { load, SyntaxParseError } from 'js-toml';\n\nfunction probe(label, toml) {\n  try {\n    load(toml);\n    console.log(`[OK]            ${label}`);\n  } catch (e) {\n    const expected = e instanceof SyntaxParseError;\n    console.log(`[${e.constructor.name}${expected ? '' : ' (UNEXPECTED)'}] ${label}: ${String(e.message).split('\\n')[0]}`);\n  }\n}\n\n// 1) Deeply nested arrays  (~2 KB payload)\nprobe('nested array depth \n\nAffected: npm:js-toml\n\nFixed in: 1.1.3\n\nReferences:\nhttps://github.com/sunnyadn/js-toml/security/advisories/GHSA-3g82-77xr-68x5\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-63386\nhttps://github.com/sunnyadn/js-toml/commit/4e10acf1f99ff3cb443c58b8f0a57664e41e87c6\nhttps://github.com/sunnyadn/js-toml\nhttps://github.com/sunnyadn/js-toml/releases/tag/v1.1.3","url":"https://osv.dev/vulnerability/GHSA-3g82-77xr-68x5","published_at":"2026-11-20T14:40:45Z","updated_at":"2026-11-20T14:45:04.348534Z","fetched_at":"2026-11-21T19:15:55.946240Z","severity":"medium","cvss_score":5.3,"epss":0.00361,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"js-toml","vuln_id":"CVE-2026-63386","vuln_ids":["CVE-2026-63386","GHSA-3G82-77XR-68X5"],"tags":["osv","npm","fix-available"],"cluster_id":2048,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10877","html":"https://vulnwatch.ve1ve2.com/item/10877"}},{"id":2313,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-3g82-77xr-68x5 / CVE-2026-63386: js-toml allows uncontrolled recursion in `load()` leading `RangeError` (stack exhaustion) on deeply nested input","summary":"js-toml allows uncontrolled recursion in `load()` leading `RangeError` (stack exhaustion) on deeply nested input\n\n## Summary\n\n`load()` parses untrusted TOML using a recursive-descent parser (Chevrotain) and a\nrecursive tree-walking interpreter. Neither the parser nor the interpreter enforces a\nmaximum nesting / key depth. A small, attacker-controlled document with deep nesting\n(arrays, inline tables) or a long dotted key drives recursion past the V8 call-stack\nlimit, and `load()` throws an **uncaught `RangeError: Maximum call stack size exceeded`**.\n\nThis is a problem for two reasons:\n\n1. **Denial of Service.** A tiny payload (≈2 KB) reliably aborts parsing. In any\n   service that parses user-supplied TOML, an unhandled `RangeError` can crash the\n   worker/process (500 / restart loop).\n2. **Error-contract violation.** The library signals invalid input via\n   `SyntaxParseError` (see `src/load/exception.ts`; the entire test suite asserts\n   `SyntaxParseError`). Consumers that follow this contract —\n\n   ```js\n   try { load(input); }\n   catch (e) {\n     if (e instanceof SyntaxParseError) return badRequest();\n     throw e; // unexpected -> propagates\n   }\n   ```\n\n   — will **re-throw** the `RangeError` instead of treating the input as malformed,\n   turning malformed input into an unexpected fatal error.\n\n## Impact\n\n- Unauthenticated attacker who can supply a TOML string to an application using\n  `js-toml` can force `load()` to throw a non-`SyntaxParseError` error.\n- If the error is not caught by a generic handler, the Node.js process terminates\n  (availability impact).\n- Even when caught generically, the documented/expected error type contract is broken,\n  which can bypass input-validation branches that key off `SyntaxParseError`.\n\nNo confidentiality or integrity impact. The error is thrown synchronously and is\ncatchable, so a consumer that catches *all* exceptions is not crashed — this is why the\nseverity is assessed Low–Medium rather than High.\n\n## Affected code / root cause\n\nThere is no depth bound anywhere in the parse pipeline. Recursion occurs in (at least)\ntwo independent places:\n\n1. **Parser (recursive descent).** `src/load/parser.ts` — `array` / `inlineTable`\n   rules recurse through `value` for each nesting level.\n2. **Interpreter (tree walk).** `src/load/interpreter.ts` —\n   `assignValue`, `createTable`, `getOrCreateArray` recurse per dotted-key segment, and\n   `cleanInternalProperties` recurses per object depth.\n\nBecause there is no configurable or hard limit, the recursion depth is bounded only by\nthe V8 stack, and overflow surfaces as a raw `RangeError`.\n\n## Steps to reproduce (PoC)\n\nEnvironment used: Node.js v20, `js-toml@1.1.2`.\n\n```js\nimport { load, SyntaxParseError } from 'js-toml';\n\nfunction probe(label, toml) {\n  try {\n    load(toml);\n    console.log(`[OK]            ${label}`);\n  } catch (e) {\n    const expected = e instanceof SyntaxParseError;\n    console.log(`[${e.constructor.name}${expected ? '' : ' (UNEXPECTED)'}] ${label}: ${String(e.message).split('\\n')[0]}`);\n  }\n}\n\n// 1) Deeply nested arrays  (~2 KB payload)\nprobe('nested array depth \n\nAffected packages: npm:js-toml\nPatched: js-toml 1.1.3","url":"https://github.com/advisories/GHSA-3g82-77xr-68x5","published_at":"2026-11-20T14:40:45Z","updated_at":"2026-11-20T14:40:46Z","fetched_at":"2026-11-21T19:15:18.416742Z","severity":"medium","cvss_score":5.3,"epss":0.00361,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"js-toml","vuln_id":"CVE-2026-63386","vuln_ids":["CVE-2026-63386","GHSA-3G82-77XR-68X5"],"tags":["ghsa","npm","CWE-400","CWE-674"],"cluster_id":2048,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2313","html":"https://vulnwatch.ve1ve2.com/item/2313"}}]}