Skip to content

fix: header security issues#10749

Merged
jasonsaayman merged 4 commits intov1.xfrom
fix/ghsa-6chq-wfr3-2hj9
Apr 18, 2026
Merged

fix: header security issues#10749
jasonsaayman merged 4 commits intov1.xfrom
fix/ghsa-6chq-wfr3-2hj9

Conversation

@jasonsaayman
Copy link
Copy Markdown
Member

@jasonsaayman jasonsaayman commented Apr 18, 2026

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

  • Summary of changes
    • isFormData: reject plain objects with Object.prototype/null prototype; require a real append; keep support for native FormData and form-data.
    • HTTP adapter: only use data.getHeaders when it’s a real function and not Object.prototype.getHeaders.
    • AxiosURLSearchParams: simplify regex and remove %00 handling (no null‑byte decoding).
  • Reasoning
    • Block attacker‑controlled getHeaders and related methods from merging malicious headers.
    • Eliminate null‑byte transformations in query encoding.
  • Additional context

Testing

  • Added a unit test that simulates Object.prototype pollution and verifies:
    • Prototype getHeaders is ignored.
    • No injected headers (e.g., x-injected, forged authorization) reach the server; legitimate auth remains intact.
  • No other tests changed.

Written for commit f898f0a. Summary will update on new commits.

@jasonsaayman jasonsaayman self-assigned this Apr 18, 2026
@jasonsaayman jasonsaayman added priority::medium A medium priority commit::fix The PR is related to a bugfix type::security The PR is a secuirty related changed normally from a CVE labels Apr 18, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/unit/adapters/http.test.js Outdated
@jasonsaayman jasonsaayman changed the title fix: header header security issues fix: header security issues Apr 18, 2026
@jasonsaayman
Copy link
Copy Markdown
Member Author

@cubic-dev-ai please review again!

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 18, 2026

@cubic-dev-ai please review again!

@jasonsaayman I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@jasonsaayman jasonsaayman merged commit 37cf18f into v1.x Apr 18, 2026
25 checks passed
@jasonsaayman jasonsaayman deleted the fix/ghsa-6chq-wfr3-2hj9 branch April 18, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::fix The PR is related to a bugfix priority::medium A medium priority type::security The PR is a secuirty related changed normally from a CVE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant