Fix Denial of Service via __proto__ Key in mergeConfig#7369
Merged
jasonsaayman merged 2 commits intov1.xfrom Feb 4, 2026
Merged
Fix Denial of Service via __proto__ Key in mergeConfig#7369jasonsaayman merged 2 commits intov1.xfrom
jasonsaayman merged 2 commits intov1.xfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses a Denial of Service vulnerability via prototype pollution by adding guards against dangerous property keys (proto, constructor, prototype) in the mergeConfig function.
Changes:
- Added checks to skip dangerous property keys that could lead to prototype pollution attacks
- Changed property lookup from direct bracket access to
Object.hasOwn()for safer property checking - Applied code formatting changes (quote style and multi-line formatting)
Contributor
There was a problem hiding this comment.
2 issues found across 1 file
Confidence score: 2/5
- The
__proto__pollution fix inlib/core/mergeConfig.jsonly guards top-level keys, so nested objects (e.g., inside headers) can still reachutils.merge, which leaves a concrete security/regression risk. - Using
Object.hasOwninlib/core/mergeConfig.jsmay crash on older supported Node.js versions (e.g., 14), creating runtime failures in those environments. - Pay close attention to
lib/core/mergeConfig.js- incomplete nested__proto__protection and potential Node.js compatibility issues.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="lib/core/mergeConfig.js">
<violation number="1" location="lib/core/mergeConfig.js:103">
P1: The fix for `__proto__` pollution is incomplete because it only checks top-level keys. Nested objects containing `__proto__` (e.g., in `headers`) are passed to `utils.merge` (via `mergeDeepProperties`), which is still vulnerable to prototype pollution. This allows attackers to bypass the fix by nesting the payload.
To fully fix this, `utils.merge` in `lib/utils.js` should be updated to skip `__proto__`, `constructor`, and `prototype` keys during deep merges.</violation>
<violation number="2" location="lib/core/mergeConfig.js:109">
P2: `Object.hasOwn` was added in Node.js 16.9.0 and is not supported in older environments that Axios likely supports (e.g., Node.js 14). Using it without a polyfill will cause crashes in those environments. Consider using `Object.prototype.hasOwnProperty.call` for better compatibility.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This was referenced Feb 8, 2026
This was referenced Feb 10, 2026
This was referenced Feb 11, 2026
|
is there a possibility that this will be fix at 0.30.x versions |
|
@arnoldc This has been fixed in version 0.30.3, which has just been released! |
14 tasks
This was referenced Feb 23, 2026
This was referenced Feb 23, 2026
This was referenced Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Harden config and object merges to block prototype pollution by ignoring proto, constructor, and prototype keys. Prevents denial-of-service when merging user input.
Written for commit 14440e3. Summary will update on new commits.