{"id":"CVE-2026-82404","aliases":["CVE-2026-82404","GHSA-p95v-992w-h6c3"],"related":[],"kind":"vulnerability","state":"published","title":"TOON: Prototype pollution when decoding untrusted TOON input","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nDecoding 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.\n\n### Impact\n\nAny service that decodes untrusted TOON is affected. Prototype pollution can escalate to denial of service or, with a suitable downstream gadget, remote code execution.\n\n### Patches\n\nUpgrade to `@toon-format/toon@2.3.1`. 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.\n\n### Workarounds\n\nNone. Upgrade is the only fix. Callers who cannot upgrade should reject input whose keys include `__proto__`, `constructor`, or `prototype` before decoding.\n\n### Port maintainers\n\nThe 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.","format":"markdown","source":"ghsa"}],"published":"2026-09-02T16:30:54.876Z","modified":"2026-09-09T21:04:42.813Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","score":8.3,"rating":"HIGH"}],"cwes":["CWE-1321"],"affected":[{"ranges":[{"version":"< 2.3.1","status":"affected"}],"vendor":"toon-format","product":"toon","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.3.1"}],"ecosystem":"npm","package":"@toon-format/toon","purl":"pkg:npm/%40toon-format/toon","source":"ghsa"}],"references":[{"url":"https://github.com/toon-format/toon/security/advisories/GHSA-p95v-992w-h6c3","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/toon-format/toon/pull/316","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/toon-format/toon/commit/94a2b7560b2b5ed903a4d466a3bce8b13daa2660","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/toon-format/toon/releases/tag/v2.3.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-82404","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/toon-format/toon","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-09-02T18:58:59.419Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-82404","url":"https://www.cve.org/CVERecord?id=CVE-2026-82404","licence":"CVE Terms of Use","modified":"2026-09-02T18:59:07.868Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p95v-992w-h6c3","url":"https://github.com/advisories/GHSA-p95v-992w-h6c3","licence":"CC-BY-4.0","modified":"2026-09-03T20:00:04.933Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-82404","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-82404","licence":"Public domain","modified":"2026-09-09T21:04:42.813Z"}],"updatedAt":"2026-11-25T22:59:36.130Z","epss":{"score":0.00398,"percentile":0.36139,"date":"2026-12-01T12:00:22.000Z"}}