GitHub Advisoryadvisory · npm

GHSA-p95v-992w-h6c3 TOON: Prototype pollution when decoding untrusted TOON input

HIGH Published 2026-09-03 Modified 2026-09-03 Official page ↗
Aliases
CVE-2026-82404
Ecosystem
npm
Packages
@toon-format/toon
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
Weaknesses
CWE-1321
Reviewed
2026-09-03

Affected packages

• npm @toon-format/toon: < 2.3.1 → fixed in 2.3.1

Description

Summary Decoding attacker-controlled TOON containing a `__proto__`, `constructor`, or `prototype` key wrote through the object's prototype chain instead of creating an own property, polluting `Object.prototype` for the whole runtime. The `expandPaths: 'safe'` path (dotted keys such as `a.__proto__.x`) was the strongest vector; plain nested objects, tabular rows, and quoted keys were all affected. The encoder had a matching defect: it silently dropped own `__proto__` properties and could fire an inherited setter while normalizing. Impact Any service that decodes untrusted TOON is affected. Prototype pollution can escalate to denial of service or, with a suitable downstream gadget, remote code execution. Patches Upgrade to `@toon-format/[email protected]`. Decoders now materialize `__proto__`/`constructor`/`prototype` as ordinary own data properties, matching `JSON.parse` semantics; the encoder preserves the same keys without invoking inherited accessors. Workarounds None. Upgrade is the only fix. Callers who cannot upgrade should reject input whose keys include `__proto__`, `constructor`, or `prototype` before decoding. Port maintainers The same bug shape can exist in any implementation that assigns decoded keys with `obj[key] = value`. Rust, Swift, Java, Python, and C# ports should audit their object-construction and path-expansion paths for the three prototype keys.

Related

Alias · CVE (1)

  • CVE-2026-82404 TOON is a compact, human-readable serialization of JSON data for LLM prompts. vulnerability

Weakness · CWE (1)

  • CWE-1321 Improperly Controlled Modification of Object Prototype Attributes weakness

References