CVE-2026-35209

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.
Configurations

Configuration 1 (hide)

cpe:2.3:a:unjs:defu:*:*:*:*:*:node.js:*:*

History

21 Jul 2026, 19:10

Type Values Removed Values Added
Summary
  • (es) defu es un software que permite a los usuarios asignar propiedades predeterminadas recursivamente. Antes de la versión 6.1.5, las aplicaciones que pasan entrada de usuario no saneada (p. ej., cuerpos de solicitud JSON analizados, registros de base de datos o archivos de configuración de fuentes no confiables) como el primer argumento a 'defu()' son vulnerables a la contaminación de prototipos. Una carga útil manipulada que contiene una clave '__proto__' puede anular los valores predeterminados previstos en el resultado fusionado. La función interna '_defu' usaba 'Object.assign({}, defaults)' para copiar el objeto de valores predeterminados. 'Object.assign' invoca al setter '__proto__', que reemplaza el '[[Prototype]]' del objeto resultante con valores controlados por el atacante. Las propiedades heredadas del prototipo contaminado luego eluden la protección de clave '__proto__' existente en el bucle 'for...in' y terminan en el resultado final. La versión 6.1.5 reemplaza 'Object.assign({}, defaults)' con la propagación de objetos ('{ ...defaults }'), que usa '[[DefineOwnProperty]]' y no invoca al setter '__proto__'.

27 Apr 2026, 23:47

Type Values Removed Values Added
CPE cpe:2.3:a:unjs:defu:*:*:*:*:*:node.js:*:*
First Time Unjs defu
Unjs
References () https://github.com/unjs/defu/commit/3942bfbbcaa72084bd4284846c83bd61ed7c8b29 - () https://github.com/unjs/defu/commit/3942bfbbcaa72084bd4284846c83bd61ed7c8b29 - Patch
References () https://github.com/unjs/defu/pull/156 - () https://github.com/unjs/defu/pull/156 - Issue Tracking, Patch
References () https://github.com/unjs/defu/releases/tag/v6.1.5 - () https://github.com/unjs/defu/releases/tag/v6.1.5 - Release Notes
References () https://github.com/unjs/defu/security/advisories/GHSA-737v-mqg7-c878 - () https://github.com/unjs/defu/security/advisories/GHSA-737v-mqg7-c878 - Mitigation, Vendor Advisory

06 Apr 2026, 18:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-04-06 18:16

Updated : 2026-07-21 19:10


NVD link : CVE-2026-35209

Mitre link : CVE-2026-35209

CVE.ORG link : CVE-2026-35209


JSON object : View

Products Affected

unjs

  • defu
CWE
CWE-1321

Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')