CVE-2026-35209: defu Prototype Pollution Vulnerability
HIGHCVE-2026-35209 is a HIGH (CVSS 7.5) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting defu libraries in the npm ecosystem. The issue involves prototype pollution via `__proto__` key in defaults argument. Remediation is available by upgrading affected packages to version 6.1.5.
CVE-2026-35209 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2026-35209
To remediate this vulnerability, upgrade all affected defu dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install defu@6.1.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls defu
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-35209, inspect your project dependencies using npm:
npm ls defu
Analyze the terminal output to locate any version of defu in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.1.5), your application is affected.
Note: The npm ls defu command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In defu, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-35209 Affected defu Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
defu
|
npm |
< 6.1.5
|
6.1.5
|
References
Frequently Asked Questions
What is CVE-2026-35209?
Which defu versions are affected?
What version fixes CVE-2026-35209?
Is defu affected?
What is the CVSS score of CVE-2026-35209?
What CWE is associated with CVE-2026-35209?
How can I check npm dependencies for CVE-2026-35209?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-737v-mqg7-c878",
"modified" : "2026-04-06T23:42:28Z",
"published" : "2026-04-04T06:17:53Z",
"aliases" : [ "CVE-2026-35209" ],
"summary" : "defu: Prototype pollution via `__proto__` key in defaults argument",
"details" : "### Impact\n\nApplications 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.\n\nA crafted payload containing a `__proto__` key can override intended default values in the merged result:\n\n```js\nimport { defu } from 'defu'\n\nconst userInput = JSON.parse('{\"__proto__\":{\"isAdmin\":true}}')\nconst config = defu(userInput, { isAdmin: false })\n\nconfig.isAdmin // true — attacker overrides the server default\n```\n\n### Root Cause\n\nThe 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.\n\n### Fix\n\nReplace `Object.assign({}, defaults)` with object spread (`{ ...defaults }`), which uses `[[DefineOwnProperty]]` and does not invoke the `__proto__` setter.\n\n### Affected Versions\n\n<= 6.1.4\n\n### Credits\n\nReported by [@BlackHatExploitation](https://github.com/BlackHatExploitation)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "defu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.1.5"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 6.1.4"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/unjs/defu/security/advisories/GHSA-737v-mqg7-c878"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35209"
}, {
"type" : "WEB",
"url" : "https://github.com/unjs/defu/pull/156"
}, {
"type" : "WEB",
"url" : "https://github.com/unjs/defu/commit/3942bfbbcaa72084bd4284846c83bd61ed7c8b29"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/unjs/defu"
}, {
"type" : "WEB",
"url" : "https://github.com/unjs/defu/releases/tag/v6.1.5"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-04T06:17:53Z",
"nvd_published_at" : "2026-04-06T18:16:44Z"
}
}