CVE-2026-61534
nichePrototype Pollution in yayson npm Store/LegacyStore Deserialization
yayson, an npm library for parsing JSON:API documents, is vulnerable to prototype pollution (CWE-1321) because Store and LegacyStore key their internal lookup tables with attacker-controlled 'type', 'id', and relationship-name strings from the document, using plain objects as the maps. A document whose type is '__proto__' — including one arriving as an 'included' resource referenced through a relationship, which bypasses any data.type allow-list — makes Store.sync() write onto Object.prototype, polluting every object in the Node.js process for its lifetime; LegacyStore is additionally reachable when a configured types mapping resolves to '__proto__'. An attacker gains at minimum process-wide denial of service or logic corruption, with escalation to authorization bypass or RCE possible only if the consuming application exposes exploitable gadgets. Any Node.js application using yayson 3.x or 4.x (<= 4.2.0) that deserializes untrusted JSON:API documents is affected. No public proof of concept or in-the-wild exploitation is known and the flaw is not in CISA KEV; severity is High (suggested CVSS v3.1 8.1 from the supplied vector, though the record also carries a 9.1 Critical rating).
What to do: Upgrade to yayson 4.3.0, which uses null-prototype lookup tables and rejects '__proto__', 'constructor', and 'prototype' as document-derived member names. As interim mitigation, reject documents whose type or relationship names are '__proto__', 'constructor', or 'prototype', and/or run Node with --disable-proto=throw. Audit whether attacker-controlled JSON:API payloads reach Store.sync()/LegacyStore.sync() and whether attacker-chosen polluted keys could influence security-sensitive logic in your application.
| yayson (npm package) — Store and LegacyStore | <= 4.2.0 (all 3.x and 4.x; verified in 3.0.0 and 4.2.0); fixed in 4.3.0 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
Yayson is a library for serializing and reading JSON API data in JavaScript. Prior to 4.3.0, Store and LegacyStore use attacker-controlled JSON:API type, id, and relationship names as keys in plain-object lookup tables in src/yayson/store.ts and src/yayson/legacy-store.ts. A document whose type is __proto__ causes model-cache writes to modify Object.prototype, with the attacker controlling the polluted property name through id and its value through attributes. The malicious type can also be supplied by an included resource, and LegacyStore is reachable when a configured types mapping resolves to __proto__. Unsafe relationship names including __proto__, constructor, and prototype provide additional document-derived member paths. The resulting process-wide prototype pollution can cause denial of service and logic corruption; authorization bypass or code execution depends on suitable gadgets in the consuming application. This issue is fixed in version 4.3.0.
- Ecosystems
- npm
- Weakness
- CWE-1321
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
- GHSA
- GHSA-325j-mg25-8q58 (critical)
In the news0 stories
No ingested article mentions this CVE yet.