🛡️ CVE-2026-35209 — defu

🟠 CVSS 8.0 — High ✅ No Known Exploit CWE-1321 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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:

```js

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](https://github.com/BlackHatExploitation)

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability none.

Weakness class

CVE-2026-35209 is classified as CWE-1321: Prototype Pollution. Attacker input can modify an object prototype, changing behaviour for objects across the application.

Affected software

CVE-2026-35209 is recorded against 1 package.

  • defu

Timeline and source

Published on 4 April 2026 and last revised on 21 July 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Package)
github.com (Web)

CVE-2026-35209 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CWE CWE-1321
Public Exploit ✅ No
Source OSV
Published 2026-04-04
Updated 2026-08-12
Modified 2026-07-21

Affected Packages

Software From version Fixed in
defu

Site Security Check

Is defu part of your stack?

CVE-2026-35209 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.