Skip to content

feat(utils): implement defensive defaults utility with prototype pollution defense (#13808) - #13809

Open
whyst0ne wants to merge 2 commits into
SecureBananaLabs:mainfrom
whyst0ne:feat/defaults-object-defense-v2
Open

whyst0ne wants to merge 2 commits into
SecureBananaLabs:mainfrom
whyst0ne:feat/defaults-object-defense-v2

Conversation

@whyst0ne

Copy link
Copy Markdown

Closes #13808
Refs #743

Summary

  • Implemented defensive object defaulting utility (defaults) in apps/api/src/utils/defaults.js.
  • Hardened against Prototype Pollution (CWE-1321) by screening dangerous keys (__proto__, constructor, prototype).
  • Added Symbol key support, own-property isolation, and Object.defineProperty assignment protecting against prototype setter traps.
  • Provided nested recursive defaulting (deep: true, defaults.deep) with WeakMap circular reference protection (CWE-400).
  • Resilient fallback for null, undefined, and primitive targets and sources (CWE-1287).
  • Added unit test suite in apps/api/src/tests/defaults.test.js (18/18 passing via node --test).

Settlement Address: 0xE5Ab26877172254B72f3AE6DA5789D2468B7B282
Estimated Bounty Tier: $800 USD

…stor cycles, and fix single-source options parsing
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.

feat(utils): implement defensive defaults utility with prototype pollution defense (ref #743)

1 participant