{"id":"GHSA-737v-mqg7-c878","revision":"b266a037aceb4d3eba4b3bbeb0ed29fe","records":[{"revision":"b266a037aceb4d3eba4b3bbeb0ed29fe","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-737v-mqg7-c878","aliases":["CVE-2026-35209"],"title":"defu: Prototype pollution via `__proto__` key in defaults argument","description":"### 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)","state":0,"publishedAt":"2026-04-04T06:17:53+00:00","modifiedAt":"2026-09-10T03:50:43.5843911+00:00","affected":[{"ecosystem":"npm","name":"defu","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"6.1.5"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/unjs/defu/security/advisories/GHSA-737v-mqg7-c878","https://nvd.nist.gov/vuln/detail/CVE-2026-35209","https://github.com/unjs/defu/pull/156","https://github.com/unjs/defu/commit/3942bfbbcaa72084bd4284846c83bd61ed7c8b29","https://github.com/unjs/defu","https://github.com/unjs/defu/releases/tag/v6.1.5"],"sourceUrl":"https://github.com/advisories/GHSA-737v-mqg7-c878","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-737v-mqg7-c878","identifiers":["GHSA-737v-mqg7-c878","CVE-2026-35209"]},"retained":false,"historicalAffected":[]}],"coverage":[]}