CVE-2026-35209
defu: Prototype pollution via `__proto__` key in defaults argument
defu is software that allows uers to assign default properties recursively. Prior to version 6.1.5, 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 resul. 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. Version 6.1.5 replaces Object.assign({}, defaults) with object spread ({ ...defaults }), which uses [[DefineOwnProperty]] and does not invoke the __proto__ setter.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.5
defu: Prototype pollution via `__proto__` key in defaults argument
defu is software that allows uers to assign default properties recursively. Prior to version 6.1.5, 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 resul. 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. Version 6.1.5 replaces Object.assign({}, defaults) with object spread ({ ...defaults }), which uses [[DefineOwnProperty]] and does not invoke the __proto__ setter.
- Record
CVE-2026-35209- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-1321
- Updated
- 2026-11-02
EUVDEUVD-2026-19394
7.5
defu is software that allows uers to assign default properties recursively. Prior to version 6.1.5, 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 resul. 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. Version 6.1.5 replaces Object.assign({}, defaults) with object spread ({ ...defaults }), which uses [[DefineOwnProperty]] and does not invoke the __proto__ setter.
- Record
EUVD-2026-19394- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-737v-mqg7-c878
7.5
defu: Prototype pollution via `__proto__` key in defaults argument
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 default
Root 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
- Record
GHSA-737v-mqg7-c878- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-1321
- Updated
- 2026-11-02
NVD
7.5
defu is software that allows uers to assign default properties recursively. Prior to version 6.1.5, 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 resul. 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. Version 6.1.5 replaces Object.assign({}, defaults) with object spread ({ ...defaults }), which uses [[DefineOwnProperty]] and does not invoke the __proto__ setter.
- Record
CVE-2026-35209- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSV
7.5
defu: Prototype pollution via `__proto__` key in defaults argument
defu is software that allows uers to assign default properties recursively. Prior to version 6.1.5, 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 resul. 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. Version 6.1.5 replaces Object.assign({}, defaults) with object spread ({ ...defaults }), which uses [[DefineOwnProperty]] and does not invoke the __proto__ setter.
- Record
CVE-2026-35209- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSVGHSA-737v-mqg7-c878
7.5
defu: Prototype pollution via `__proto__` key in defaults argument
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 default
Root 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
- Record
GHSA-737v-mqg7-c878- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-1321
- Updated
- 2026-11-02
OSVCLSA-2026-1780879894 No score
TuxCare security update for defu (1 CVE)
TuxCare rebuilt defu to address 1 CVE. Fixed in 6.1.2-tuxcare.1.
- Record
CLSA-2026-1780879894- Updated
- 2026-11-02
OSVCLSA-2026-1784596329 No score
TuxCare security update for defu (1 CVE)
TuxCare rebuilt defu to address 1 CVE. Fixed in 5.0.1-tuxcare.1.
- Record
CLSA-2026-1784596329- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2026-35209 No score
CVE-2026-35209 in @rootio/defu - Patched by Root
Root has patched CVE-2026-35209 in the @rootio/defu package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-35209- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
defunpm |
through 6.1.4 | 6.1.5 |
defuTuxCare:npm |
6.1.2-tuxcare.0 up to 6.1.2-tuxcare.1, plus listed versions 6.1.2 |
6.1.2-tuxcare.1 |
defuTuxCare:npm |
5.0.1-tuxcare.0 up to 5.0.1-tuxcare.1, plus listed versions 5.0.1 |
5.0.1-tuxcare.1 |
defunpm |
before 6.1.5 | 6.1.5 |
@rootio/defuRoot:npm |
before 6.1.4-root.io.1 | 6.1.4-root.io.16.1.4-root.io.2 |
defuRoot:npm |
before 6.1.4-aikido.2 | 6.1.4-aikido.2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-35209 is a high vulnerability (CVSS 7.5) in Unjs Defu, published April 4, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.40%, the 34th percentile. Fixed in defu 6.1.5.
References
github.com/unjs/defu/security/advisories/GHSA-737v-mqg7-c878
github.com/unjs/defu/pull/156
github.com/unjs/defu/commit/3942bfbbcaa72084bd4284846c83bd61ed7c8b29
github.com/unjs/defu/releases/tag/v6.1.5
nvd.nist.gov/vuln/detail/CVE-2026-35209
github.com/advisories/GHSA-737v-mqg7-c878
github.com/CVEProject/cvelistV5/tree/main/cves/2026/35xxx/CVE-2026-35209.json
github.com/unjs/defu