🐛 [VULN-81506] fix prototype pollution via mergeInto and tryJsonParse#4820
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 6291b50 | Docs | Datadog PR Page | Give us feedback! |
Bundles Sizes Evolution
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 755693fc1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Skips __proto__, constructor, and prototype keys during recursive merge to prevent Object.prototype corruption via attacker-controlled input.
Adds a JSON reviver that drops __proto__, constructor, and prototype keys at parse time — defense in depth for external cookie/JSON input.
755693f to
6291b50
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Motivation
mergeIntoperformed a recursive deep merge without guarding against__proto__, making it possible for external input to corruptObject.prototype.Changes
mergeIntosafe against prototype pollution by skipping__proto__during recursive mergetryJsonParsenever returns objects carrying__proto__as an own propertystoreContextManagerandremoteConfigurationCacheagainst malformed or untrusted localStorage dataBehavioral changes
mergeInto(andcombine,deepClone) now silently drops the__proto__key.tryJsonParsestrips it from parsed JSON.Test instructions
Checklist