Saltar al contenido
DayZeroHub
Media Sin redactarCVSS 5.3GHSA-3g82-77xr-68x5CVE-2026-63386

CVE-2026-63386: js-toml allows uncontrolled recursion in `load()` leading `RangeError` (stack exhaustion) on deeply nested input

js-toml

Aviso preliminar: se publicó de inmediato con los datos originales de las fuentes, sin redacción editorial. En breve se reemplaza por una versión redactada y revisada.

Resumen

CVE-2026-63386: vulnerabilidad de severidad media (CVSS 5.3) en js-toml.

Qué ocurre

Descripción original de la fuente (en inglés): ## Summary `load()` parses untrusted TOML using a recursive-descent parser (Chevrotain) and a recursive tree-walking interpreter. Neither the parser nor the interpreter enforces a maximum nesting / key depth. A small, attacker-controlled document with deep nesting (arrays, inline tables) or a long dotted key drives recursion past the V8 call-stack limit, and `load()` throws an **uncaught `RangeError: Maximum call stack size exceeded`**. This is a problem for two reasons: 1. **Denial of Service.** A tiny payload (≈2 KB) reliably aborts parsing. In any service that parses user-supplied TOML, an unhandled `RangeError` can crash the worker/process (500 / restart loop). 2. **Error-contract violation.** The library signals invalid input via `SyntaxParseError` (see `src/load/exception.ts`; the entire test suite asserts `SyntaxParseError`). Consumers that follow this contract — ```js try { load(input); } catch (e) { if (e instanceof SyntaxParseError) return badRequest(); throw e; // unexpected -> propagates } ``` — will **re-throw** the `RangeError` instead of treating the input as malformed, turning malformed input into an unexpected fatal error. ## Impact - Unauthenticated attacker who can supply a TOML string to an application using `js-toml` can force `load()` to throw a non-`SyntaxParseError` error. - If the error is not caught by a generic handler, the Node.js process terminates (availability impact). - Even when caught generically, the documented/expected error type contract is broken, which can bypass input-validation branches that key off `SyntaxParseError`. No confidentiality or integrity impact. The error is thrown synchronously and is catchable, so a consumer that ca…

Por qué importa

Severidad media, CVSS 5.3.

Productos y versiones afectados

js-toml < 1.1.3 (corregido en 1.1.3)

ProductoVersionesCorregido en
js-toml< 1.1.31.1.3

Acción recomendada por la fuente

Actualizar a una versión corregida: 1.1.3.

Corregido en: 1.1.3

Información tomada de la fuente o del proveedor. Verificala en el enlace original antes de actuar.

Fuentes y referencias

Debilidades (CWE): CWE-400, CWE-674

Historial de cambios relevantes

  1. Publicado

    Aviso preliminar publicado.