Skip to content

fix: header security issues - #10750

Merged
jasonsaayman merged 3 commits into
v0.xfrom
fix/ghsa-6chq-wfr3-2hj9-v0x
Apr 18, 2026
Merged

jasonsaayman merged 3 commits into
v0.xfrom
fix/ghsa-6chq-wfr3-2hj9-v0x

Conversation

@jasonsaayman

@jasonsaayman jasonsaayman commented Apr 18, 2026 •

Copy link
Copy Markdown
Member

Summary by cubic

Hardened FormData detection and header merging in the Node HTTP adapter to block prototype‑pollution header injection (GHSA-6chq-wfr3-2hj9). Prevents polluted getHeaders from being merged and only treats genuine FormData as FormData; synced with v0.x.

Description

  • Tighten isFormData in lib/utils.js: reject plain objects (Object.prototype or no prototype), require append, keep toString/Symbol.toStringTag checks, short‑circuit on falsy.
  • Guard header merge in lib/adapters/http.js: only merge data.getHeaders() if it exists and isn’t Object.prototype.getHeaders.
  • Synced with v0.x to keep branch up to date; no behavior changes.

Testing

  • Added unit test that simulates prototype pollution and verifies:
    • Polluted getHeaders aren’t merged; injected headers are not sent.
    • Legit Authorization header is preserved and request reaches the server.

Written for commit 50ac5a3. Summary will update on new commits.

@jasonsaayman jasonsaayman self-assigned this Apr 18, 2026
@jasonsaayman jasonsaayman added priority::medium type::security The PR is a secuirty related changed normally from a CVE labels Apr 18, 2026

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

Copy link
Copy Markdown
Contributor

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 e3ddeb4 into v0.x Apr 18, 2026
14 checks passed
@jasonsaayman
jasonsaayman deleted the fix/ghsa-6chq-wfr3-2hj9-v0x branch April 18, 2026 13:00
shaanmajid pushed a commit to shaanmajid/axios that referenced this pull request Jul 16, 2026
* fix: header security issues

* chore: dont allow passing on any error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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