GHSA-p95v-992w-h6c3

Suggest an improvement
Source
https://github.com/advisories/GHSA-p95v-992w-h6c3
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-p95v-992w-h6c3/GHSA-p95v-992w-h6c3.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-p95v-992w-h6c3
Aliases
Published
2026-09-03T19:52:08Z
Modified
2026-09-03T20:00:04Z
Severity
  • 8.3 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L CVSS Calculator
Summary
TOON: Prototype pollution when decoding untrusted TOON input
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-09-03T19:52:08Z",
    "nvd_published_at": "2026-09-02T17:18:00Z",
    "severity": "HIGH"
}
References

Affected packages

npm / @toon-format/toon

Package

Name
@toon-format/toon
View open source insights on deps.dev
Purl
pkg:npm/%40toon-format/toon

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.3.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-p95v-992w-h6c3/GHSA-p95v-992w-h6c3.json"