High

TOON: Prototype pollution when decoding untrusted TOON input

  • Disclosed: 03.09.2026
  • Updated: 11.10.2026 10:22

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/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.

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @toon-format/toon < 2.3.1 2.3.1

References

CVSS score 8.3/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
Weakness (CWE)
CWE-1321
Platform
npm
Package
@toon-format/toon
Disclosed
03.09.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-p95v-992w-h6c3 - CC BY 4.0

Vulnerability history: @toon-format/toon

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.