Skip to content

security(batch2): guard mergeDeep against prototype-pollution keys (#8)#1

Merged
polydoc-tech merged 1 commit into
mainfrom
security/post-audit-batch2
Jun 18, 2026
Merged

security(batch2): guard mergeDeep against prototype-pollution keys (#8)#1
polydoc-tech merged 1 commit into
mainfrom
security/post-audit-batch2

Conversation

@polydoc-tech

Copy link
Copy Markdown
Owner

Security audit batch 2 — #8 (prototype-pollution guard in the shared mergeDeep).

The advanced-JSON escape hatch deep-merges user-supplied input. mergeDeep
skipped no keys, so a {"__proto__":{...}} payload (an own key when it arrives
via JSON) reassigned the merged object's prototype. Added a guard that skips
__proto__ / constructor / prototype.

Real blast radius is small (the merge is non-mutating, so it never polluted the
global Object.prototype); this is a defense-in-depth / consistency fix applied
across all the connectors.

Test: a malicious payload no longer reaches the prototype, legit keys still
merge. Fails without the guard. tsc clean.

🤖 Generated with Claude Code

The advanced-JSON escape hatch deep-merges user-supplied input via mergeDeep.
Skip __proto__/constructor/prototype keys so a crafted advanced payload cannot
reassign the result object's prototype.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@polydoc-tech
polydoc-tech merged commit b555927 into main Jun 18, 2026
2 checks passed
@polydoc-tech
polydoc-tech deleted the security/post-audit-batch2 branch June 18, 2026 14:45
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.

1 participant