TOON
TOON: Prototype pollution when decoding untrusted TOON input
TOON is a compact, human-readable serialization of JSON data for LLM prompts. Prior to 2.3.1, decoding attacker-controlled TOON with a __proto__, constructor, or prototype key wrote through the object prototype chain instead of creating an own property, polluting Object.prototype for the runtime. In packages/toon/src/decode/expand.ts, the expandPaths: 'safe' path and insertPathSafe function made dotted keys such as a.__proto__.x the strongest vector, while plain nested objects, tabular rows, quoted keys, and streaming decode were also affected. The encoder also dropped own __proto__ properties and could invoke an inherited setter during normalization. Services that decode untrusted TOON could experience denial of service or, when a suitable downstream gadget is present, remote code execution. This issue is fixed in version 2.3.1.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 2.3.1
Fixed in 2.3.1
Mitigation
Upgrade toon to 2.3.1 or later.
References
- Vendor advisory github.com/toon-format/toon/security/advisorie…
- Patch github.com/toon-format/toon/pull/316
- Patch github.com/toon-format/toon/commit/94a2b7560b2…
1 more
- Release notes github.com/toon-format/toon/releases/tag/v2.3.…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.