CVE-2026-82404: 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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.3.1
Event History
Frequently Asked Questions
Which deployments are exposed?
Services that decode attacker-controlled TOON input are exposed. The issue can affect the runtime globally by polluting Object.prototype, including through dotted keys, plain nested objects, tabular rows, quoted keys, and streaming decode.
What does an attacker need to exploit this?
An attacker needs to supply TOON input for decoding; the listed vector requires no privileges or user interaction. Payloads using __proto__, constructor, or prototype keys can trigger prototype-chain writes, with dotted paths such as a.__proto__.x identified as the strongest vector.
Are there risks beyond decoding?
Yes. The encoder could drop own __proto__ properties and could invoke an inherited setter during normalization. The described impact includes denial of service and potentially remote code execution when a suitable downstream gadget is present.
What version resolves the issue?
Upgrade TOON to version 2.3.1. Versions prior to 2.3.1 are affected.