fix: header security issues#10749
Merged
jasonsaayman merged 4 commits intov1.xfrom Apr 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 5/5
- Low merge risk overall: the only finding is low severity (3/10) and limited to a unit test expectation in
tests/unit/adapters/http.test.js, not production runtime logic. - Most notable issue is that treating an arbitrary request error as success could let the test pass without actually validating that prototype-polluted headers are ignored, which weakens test assurance.
- Pay close attention to
tests/unit/adapters/http.test.js- tighten the error assertion so the test proves the intended security-related behavior rather than passing on unrelated failures.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/unit/adapters/http.test.js">
<violation number="1" location="tests/unit/adapters/http.test.js:2570">
P3: Don't treat an arbitrary request error as success here; it lets the test pass without proving that prototype-polluted headers were ignored.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Member
Author
|
@cubic-dev-ai please review again! |
Contributor
@jasonsaayman I have started the AI code review. It will take a few minutes to complete. |
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
Hardened FormData detection and header merging to block prototype‑pollution header injection (GHSA-6chq-wfr3-2hj9). Tightened URL encoding to avoid null‑byte decoding in query params.
Description
isFormData: reject plain objects withObject.prototype/null prototype; require a realappend; keep support for nativeFormDataandform-data.data.getHeaderswhen it’s a real function and notObject.prototype.getHeaders.AxiosURLSearchParams: simplify regex and remove%00handling (no null‑byte decoding).getHeadersand related methods from merging malicious headers.Testing
Object.prototypepollution and verifies:getHeadersis ignored.x-injected, forgedauthorization) reach the server; legitimate auth remains intact.Written for commit f898f0a. Summary will update on new commits.