Skip to main content

yayson: Prototype pollution in Store/LegacyStore deserialization (CVE-2026-61534)

0
Critical
Published: 09/11/2026 (09/11/2026, 22:11:38 UTC)
Source: GCVE Database
Product: yayson

Description

# Summary `Store`/`LegacyStore` key internal lookup tables by the `type`, `id`, and relationship names from a JSON:API document. Because these were plain objects, a document with `type: "__proto__"` writes onto `Object.prototype`, polluting every object in the process. # Severity Suggested CVSS v3.1 `AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H` (8.1). The guaranteed impact is process-wide DoS / logic corruption; escalation to authorization bypass or RCE is dependent on gadgets in the consuming application. # Affected / Patched - Affected: `<= 4.2.0` (verified in `3.0.0` and `4.2.0`; all 3.x and 4.x). - Patched: `4.3.0`. # Details `type` is a string *value*, untouched by `JSON.parse`, and is used directly as an object key: ```js if (!models[type]) models[type] = {} // models["__proto__"] is Object.prototype → skipped if (!models[type][id]) models[type][id] = model // → Object.prototype[id] = model ``` The attacker controls the polluted key (`id`) and value (the model, populated from `attributes`). Pollution persists for the process lifetime. The malicious type can also arrive via an `included` resource referenced by a relationship, bypassing any `data.type` allow-list. `LegacyStore` is additionally reachable when a configured `types` mapping resolves to `"__proto__"`. # Proof of concept ```js const { Store } = require('yayson')() new Store().sync({ data: { type: '__proto__', id: 'polluted', attributes: { x: 1 } } }) console.log(({}).polluted) // { x: 1, id: 'polluted' } ← Object.prototype polluted ``` # Workarounds Reject documents whose `type` or relationship names are `__proto__`, `constructor`, or `prototype`, or run Node with `--disable-proto=throw`. # Fix Null-prototype lookup tables, rejection of `__proto__`/`constructor`/`prototype` as document-derived member names, `Object.keys()` iteration, and null-prototype normalization of caller-supplied caches.

CVSS v3.1

Score 9.1critical

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

Affected software

npmghsa
yayson
Affected versions
<4.3.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/12/2026, 00:45:02 UTC

Technical Analysis

The yayson library's Store and LegacyStore components use plain objects keyed by the 'type' field from JSON:API documents. If an attacker submits a document with type set to "__proto__", this key overwrites Object.prototype, polluting all objects in the process. The attacker controls the polluted key and value, which can lead to process-wide denial of service or logic corruption. The vulnerability is present in all versions up to and including 4.2.0 and was patched in 4.3.0 by using null-prototype lookup tables and rejecting dangerous keys. The vulnerability has a CVSS v3.1 score of 9.1 (critical).

Potential Impact

The guaranteed impact is process-wide denial of service or logic corruption due to prototype pollution. While confidentiality is not affected, integrity and availability are highly impacted. Escalation to authorization bypass or remote code execution depends on the presence of exploitable gadgets in the consuming application. The pollution persists for the lifetime of the process, affecting all objects.

Mitigation Recommendations

A fix is available in yayson version 4.3.0. Users should upgrade to this version to remediate the vulnerability. As a workaround, reject JSON:API documents whose 'type' or relationship names are '__proto__', 'constructor', or 'prototype'. Alternatively, run Node.js with the --disable-proto=throw flag to prevent prototype pollution. No other mitigation is required once patched.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-325j-mg25-8q58
Osv Schema Version
1.4.0
Aliases
["CVE-2026-61534"]
Ecosystems
["npm"]
Database Specific Severity
CRITICAL
Cvss Version
3.1

Threat ID: 6aa49ff055bf5e2cf5a861e3

Added to database: 09/12/2026, 00:42:24 UTC

Last enriched: 09/12/2026, 00:45:02 UTC

Last updated: 09/12/2026, 01:19:51 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses