Prototype Pollution
CVE-2026-35209
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted JSON with __proto__ key
-
Exploitdefu() merges unsanitized input
-
ExecutionPrototype pollution overwrites default values
-
ImpactAttacker gains unauthorized privileges
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V3 - Web Frontend Security Prototype pollution prevention
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires application using defu library to pass unsanitized user input (JSON, database records, config files) as first argument to defu(). Remote unauthenticated attacker sends crafted payload with __proto__ key in request body or data source. No victim interaction needed. |
| Impact | Real-world risk is HIGH for applications passing untrusted input to defu, despite no confirmed active exploitation (not present in CISA KEV). The CVSS vector (AV:N/AC:L/PR:N/UI:N) indicates trivial exploitation: network-accessible, low complexity, requiring no authentication or user interaction. The Impact metric (I:H) reflects the ability to override critical application logic like authentication flags, as demonstrated in the proof-of-concept where isAdmin defaults can be flipped. Attack complexity is genuinely low-developers commonly pass JSON.parse() results directly to configuration merging functions without sanitization. The GitHub advisory includes working exploit code, lowering the barrier for opportunistic exploitation. However, exploitability depends on application-specific usage patterns: only applications merging untrusted input as the first argument to defu() are vulnerable, not all installations. SSVC analysis suggests immediate attention: exploitation is proven (POC exists), the vulnerability is automatable (scannable via dependency trees), and technical impact includes authentication bypass (CWE-1321 often leads to privilege escalation or denial of service). Prioritization should focus on public-facing applications using defu for user input processing, particularly authentication/authorization systems. The narrow attack surface (requires specific API misuse) may explain absence from KEV despite high CVSS, but applications fitting the vulnerable pattern face imminent risk given the published exploit details. |
| Exploit ScenarioDerived | An attacker targets a Node.js web application using defu to merge user registration data with default settings. The application accepts POST requests to /api/register with JSON bodies and uses defu(req.body, {isAdmin: false, role: 'user'}) to ensure safe defaults. The attacker crafts a malicious registration payload: {"username":"attacker","__proto__":{"isAdmin":true,"role":"admin"}}. When the application passes this unsanitized JSON to defu(), the __proto__ setter pollutes the prototype chain, causing the merged config object to inherit isAdmin:true instead of the intended false default. The application stores this polluted configuration and grants the attacker administrative privileges, bypassing authentication controls. Publicly available exploit code in the GitHub advisory enables rapid exploitation by automated scanners or opportunistic attackers against vulnerable endpoints. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 04, 2026
Prototype pollution in defu npm package (≤6.1.4) allows remote attackers to override application logic by injecting __proto__ keys through unsanitized user input. The vulnerability enables authentication bypass and arbitrary property injection when applications merge untrusted JSON, database records, or configuration data using defu(). CVSS 7.5 (High) with network-accessible, low-complexity exploitation requiring no authentication. No active exploitation confirmed (not in CISA KEV), but public proof-of-concept exists in the GitHub advisory demonstrating admin privilege escalation.
RemediationAI
Upgrade defu to version 6.1.5 or later, which replaces Object.assign({}, defaults) with object spread syntax ({...defaults}) to prevent __proto__ setter invocation during object copying. The fix is available through standard npm package managers: run npm update defu, yarn upgrade defu, or pnpm update defu depending on your package manager, then verify package.json and lockfiles reflect version >6.1.4. For applications unable to upgrade immediately, implement input sanitization by removing __proto__, constructor, and prototype keys from user-controlled objects before passing to defu(), or use object freezing (Object.freeze) on default configuration objects. Code review should identify all defu() call sites where the first argument originates from external sources (req.body, database queries, file uploads) and prioritize those for remediation. Consult the official GitHub security advisory at https://github.com/unjs/defu/security/advisories/GHSA-737v-mqg7-c878 for additional mitigation guidance and https://github.com/advisories/GHSA-737v-mqg7-c878 for ecosystem-wide impact details. Post-upgrade testing should verify that configuration merging behavior remains consistent while blocking prototype pollution attempts.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The defu library is a popular JavaScript object merging utility used in Node.js applications for configuration management and default value assignment. The vulnerability stems from the internal _defu function's use of Object.assign({}, defaults) to shallow-copy the defaults object. Object.assign invokes property setters during assignment, including the special __proto__ setter which modifies an object's prototype chain. When an attacker supplies input containing {"__proto__":{"isAdmin":true}}, Object.assign triggers the __proto__ setter, polluting the resulting object's prototype. Although defu contained a for...in loop guard to skip __proto__ keys, properties inherited from the polluted prototype bypass this check and appear in the final merged result. This is a classic manifestation of CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes), commonly known as prototype pollution. The affected package (pkg:npm/defu) is widely used in the JavaScript ecosystem, particularly in frameworks like Nuxt.js and other unjs projects for configuration merging.
Know when Prototype Pollution gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Primary rating from Vendor (https://github.com/unjs/defu) · only source for this CVE.
CVSS VectorVendor: https://github.com/unjs/defu
Lifecycle Timeline
2DescriptionCVE.org
Impact
Applications that pass unsanitized user input (e.g. parsed JSON request bodies, database records, or config files from untrusted sources) as the first argument to defu() are vulnerable to prototype pollution.
A crafted payload containing a __proto__ key can override intended default values in the merged result:
import { defu } from 'defu'
const userInput = JSON.parse('{"__proto__":{"isAdmin":true}}')
const config = defu(userInput, { isAdmin: false })
config.isAdmin // true - attacker overrides the server defaultRoot Cause
The internal _defu function used Object.assign({}, defaults) to copy the defaults object. Object.assign invokes the __proto__ setter, which replaces the resulting object's [[Prototype]] with attacker-controlled values. Properties inherited from the polluted prototype then bypass the existing __proto__ key guard in the for...in loop and land in the final result.
Fix
Replace Object.assign({}, defaults) with object spread ({ ...defaults }), which uses [[DefineOwnProperty]] and does not invoke the __proto__ setter.
Affected Versions
<= 6.1.4
Credits
Reported by @BlackHatExploitation
Executive ViewAI
The defu npm package (versions ≤6.1.4) contains a prototype pollution vulnerability that allows unauthenticated remote attackers to inject malicious properties into application objects, potentially bypassing authentication and escalating privileges. Any application using defu to merge untrusted data-including user input, API responses, or database records-is vulnerable and requires immediate dependency review and mitigation. This affects the integrity of application logic and access controls across dependent systems.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement strict input validation to reject or sanitize any JSON containing __proto__, prototype, or constructor keys before processing; (2) Use Object.freeze() on sensitive configuration objects post-merge; (3) Restrict defu() to trusted data sources only; (4) Implement runtime monitoring for unexpected property mutations on critical authentication and authorization objects; (5) Consider alternative merge libraries without prototype pollution history pending patch availability.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Affected Products (CPE)CVE.org
More in Prototype Pollution
View allPrototype pollution in Adobe Acrobat Reader versions 24.001.30356, 26.001.21367 and earlier enables arbitrary code execu
All versions of package dojo are vulnerable to Prototype Pollution via the setObject function. Rated critical severity (
Prototype pollution in the farinspace Partners WordPress plugin (versions up to and including 0.2.0) enables remote unau
The package handlebars before 4.7.7 are vulnerable to Prototype Pollution when selecting certain compiling options to co
This affects the package ini before 1.3.6. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitabl
Prototype pollution vulnerability in 'deephas' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service
A Prototype Pollution issue in Cronvel Tree-kit v.0.7.4 and before allows a remote attacker to execute arbitrary code vi
A Prototype Pollution issue in Aliconnect /sdk v.0.0.6 allows an attacker to execute arbitrary code via the aim function
All versions of the package safe-eval are vulnerable to Prototype Pollution via the safeEval function, due to improper s
This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr
Prototype Pollution in chargeover redoc v2.0.9-rc.69 allows attackers to execute arbitrary code or cause a Denial of Ser
alizeait unflatto <= 1.0.2 was discovered to contain a prototype pollution via the method exports.unflatto at /dist/inde
GHSA-737v-mqg7-c878
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB