Skip to content

Update devDependency defu to v6.1.5 [SECURITY]#160

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-defu-vulnerability
Open

Update devDependency defu to v6.1.5 [SECURITY]#160
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-defu-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
defu 6.1.46.1.5 age confidence

defu: Prototype pollution via __proto__ key in defaults argument

CVE-2026-35209 / GHSA-737v-mqg7-c878

More information

Details

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

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

unjs/defu (defu)

v6.1.5

Compare Source

compare changes

🩹 Fixes
  • Prevent prototype pollution via __proto__ in defaults (#​156)
  • Ignore inherited enumerable properties (11ba022)
🏡 Chore
✅ Tests
  • Add more tests for plain objects (b65f603)
🤖 CI
❤️ Contributors

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • "after 2am and before 5am"

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@vercel

vercel Bot commented Apr 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ungh Ready Ready Preview, Comment Jun 2, 2026 12:38am

Request Review

@renovate renovate Bot force-pushed the renovate/npm-defu-vulnerability branch from ba20225 to 28aac82 Compare April 8, 2026 16:11
@renovate renovate Bot changed the title chore(deps): update devdependency defu to v6.1.5 [security] Update devDependency defu to v6.1.5 [SECURITY] Apr 8, 2026
@renovate renovate Bot changed the title Update devDependency defu to v6.1.5 [SECURITY] Update devDependency defu to v6.1.5 [SECURITY] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot deleted the renovate/npm-defu-vulnerability branch April 27, 2026 16:39
@renovate renovate Bot changed the title Update devDependency defu to v6.1.5 [SECURITY] - autoclosed Update devDependency defu to v6.1.5 [SECURITY] Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
@renovate renovate Bot force-pushed the renovate/npm-defu-vulnerability branch 2 times, most recently from 28aac82 to 3a8ba9c Compare April 27, 2026 20:41
@renovate renovate Bot force-pushed the renovate/npm-defu-vulnerability branch from 3a8ba9c to b190c08 Compare May 12, 2026 13:58
@renovate renovate Bot force-pushed the renovate/npm-defu-vulnerability branch from b190c08 to b112f5f Compare May 17, 2026 01:56
@renovate renovate Bot force-pushed the renovate/npm-defu-vulnerability branch from b112f5f to cfade62 Compare May 28, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants