GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Clean up error handling, fix a proto-pollution gap, and seal a few loose ends by Mohammad-Faiz-Cloud-Engineer · Pull Request #10922 · axios/axios

Conversation

@Mohammad-Faiz-Cloud-Engineer

@Mohammad-Faiz-Cloud-Engineer Mohammad-Faiz-Cloud-Engineer commented May 20, 2026 •
edited by cubic-dev-ai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Been poking around the codebase and found a handful of things that needed tidying up:

  • resolveConfig.js - config.params and config.paramsSerializer were being accessed directly off user input instead of going through the own() guard. If someone crafted a config with inherited params from the prototype, you'd get unexpected behavior. Swapped to own('params') / own('paramsSerializer') like the rest of the module does.

  • http.js - there was a stray console.warn('emit error', err) in an abort-event catch block. Debug leftover, shouldn't reach production. Replaced with a quiet catch.

  • AxiosHeaders.js - three places were throwing raw Error or TypeError instead of AxiosError. Swapped them over with ERR_BAD_OPTION_VALUE. Also added the missing AxiosError import (creates a circular dep with AxiosError.js which imports AxiosHeaders, but it works fine at runtime since the throws are inside method bodies, not at module eval time).

  • toFormData.js - the circular reference detection was throwing a bare Error. Changed to AxiosError without a code, so it stays distinguishable from the depth-exceeded error that uses ERR_FORM_DATA_DEPTH_EXCEEDED. (There's a test that explicitly checks this distinction.)

  • formDataToStream.js - two more raw throws (TypeError and Error) → AxiosError.

  • buildURL.js - import self-path ../helpers/AxiosURLSearchParams.js when it lives in the same directory as the importer. Changed to ./AxiosURLSearchParams.js.

  • index.d.cts - CanceledError was missing readonly name: 'CanceledError' that index.d.ts already has. Added it to keep the CJS declarations in sync.

Lint passes clean, all 770 unit tests green. Nothing breaking - all changes are either internal (no consumer-facing API change) or type-only.


Summary by cubic

Hardened config resolution to block prototype pollution in params/paramsSerializer, kept native error types, and tidied a few minor issues. Also updated pre-release notes.

Description

  • Guard resolveConfig with own('params') and own('paramsSerializer') to ignore inherited values.
  • Keep native Error/TypeError in AxiosHeaders, formDataToStream, and toFormData (use new where missing).
  • Fix buildURL import to ./AxiosURLSearchParams.js; silence stray console.warn in the Node HTTP abort handler.
  • Add readonly name: 'CanceledError' to CJS typings in index.d.cts.

Docs

  • Added pre-release changelog notes for config hardening and CJS CanceledError typing.
  • Suggest adding a short note in /docs/ that config resolution ignores inherited params/paramsSerializer.

Testing

  • Added unit tests to ensure resolveConfig ignores inherited params and paramsSerializer and does not call polluted serializers.
  • No additional tests needed.

Semantic version impact

  • Patch. No API changes.

Written for commit d537120. Summary will update on new commits. Review in cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Mohammad-Faiz-Cloud-Engineer
Clean up error handling, fix a proto-pollution gap, and seal a few lo…
502433d
…ose ends.

Been poking around the codebase and found a handful of things that needed tidying up:

- resolveConfig.js - config.params and config.paramsSerializer were being accessed directly off user input instead of going through the own() guard. If someone crafted a config with inherited params from the prototype, you'd get unexpected behavior. Swapped to own('params') / own('paramsSerializer') like the rest of the module does.

- http.js - there was a stray console.warn('emit error', err) in an abort-event catch block. Debug leftover, shouldn't reach production. Replaced with a quiet catch.

- AxiosHeaders.js - three places were throwing raw Error or TypeError instead of AxiosError. Swapped them over with ERR_BAD_OPTION_VALUE. Also added the missing AxiosError import (creates a circular dep with AxiosError.js which imports AxiosHeaders, but it works fine at runtime since the throws are inside method bodies, not at module eval time).

- toFormData.js - the circular reference detection was throwing a bare Error. Changed to AxiosError without a code, so it stays distinguishable from the depth-exceeded error that uses ERR_FORM_DATA_DEPTH_EXCEEDED. (There's a test that explicitly checks this distinction.)

- formDataToStream.js - two more raw throws (TypeError and Error) → AxiosError.

- buildURL.js - import self-path ../helpers/AxiosURLSearchParams.js when it lives in the same directory as the importer. Changed to ./AxiosURLSearchParams.js.

- index.d.cts - CanceledError was missing readonly name: 'CanceledError' that index.d.ts already has. Added it to keep the CJS declarations in sync.

Lint passes clean, all 770 unit tests green. Nothing breaking - all changes are either internal (no consumer-facing API change) or type-only.
@Mohammad-Faiz-Cloud-Engineer
Mohammad-Faiz-Cloud-Engineer requested a review from jasonsaayman as a code owner May 20, 2026 23:05
cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed May 20, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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 7 files

Confidence score: 5/5

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

Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasonsaayman jasonsaayman assigned Mohammad-Faiz-Cloud-Engineer May 24, 2026
@jasonsaayman jasonsaayman added priority::medium labels May 24, 2026
@Mohammad-Faiz-Cloud-Engineer
Update AxiosHeaders.js
05a9d81
cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed May 24, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/core/AxiosHeaders.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Mohammad-Faiz-Cloud-Engineer
Update AxiosHeaders.js
2d36ef2
jasonsaayman
jasonsaayman requested changes May 26, 2026
View reviewed changes

@jasonsaayman jasonsaayman left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think this could land as it is. We would have a couple of breaking changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/core/AxiosHeaders.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/core/AxiosHeaders.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/core/AxiosHeaders.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/helpers/formDataToStream.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/helpers/formDataToStream.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/helpers/toFormData.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/helpers/resolveConfig.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jasonsaayman jasonsaayman added the status::changes-requested A reviewer requested changes to the PR label May 26, 2026
Mohammad-Faiz-Cloud-Engineer added 2 commits May 27, 2026 00:14
@Mohammad-Faiz-Cloud-Engineer
fix: revert breaking error-type changes per review feedback
f3a9873
Reverts AxiosError throws back to native Error/TypeError in AxiosHeaders,
formDataToStream, and toFormData to avoid breaking existing consumers
who catch by constructor name or check isAxiosError().

Adds regression tests for resolveConfig own('params')/own('paramsSerializer')
guard as requested in review.

Removes unused AxiosError imports from AxiosHeaders and formDataToStream.
@Mohammad-Faiz-Cloud-Engineer
Merge branch 'v1.x' into v1.x
09f8ad3
@Mohammad-Faiz-Cloud-Engineer

Mohammad-Faiz-Cloud-Engineer commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @jasonsaayman. I've addressed all the feedback:

Reverted - all 6 error-type changes that were breaking:

  • AxiosHeaders.js: 3 throws back to native Error/TypeError (the set() empty header name, set() iterator type, and get() parser validator)

  • formDataToStream.js: 2 throws back to native TypeError/Error

  • toFormData.js: circular reference throw back to native Error

Removed the unused AxiosError imports that the PR had added alongside those throws.

Added - 2 regression tests in prototypePollution.test.js for the resolveConfig own('params') / own('paramsSerializer') guard, verifying that polluted prototype values are correctly ignored.

Kept the non-breaking fixes (buildURL import path, http.js quiet catch, index.d.cts CanceledError name sync).
Lint passes clean, all 732 unit tests green.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed May 26, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

3 issues found across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/core/AxiosHeaders.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/helpers/formDataToStream.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/helpers/toFormData.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

jasonsaayman
jasonsaayman approved these changes May 26, 2026
View reviewed changes
@jasonsaayman
docs: add pre-release notes for config hardening
9a42201
@Mohammad-Faiz-Cloud-Engineer

Mohammad-Faiz-Cloud-Engineer commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

The three files flagged in the description as switching to AxiosError (AxiosHeaders.js, formDataToStream.js, toFormData.js) were reverted back to native Error/TypeError per maintainer review those are non-breaking now. The AxiosError imports were removed too.

What was actually changed in f3a9873:

  • resolveConfig.js --> own() guard on params/paramsSerializer (proto-pollution fix) + 2 regression tests
  • buildURL.js --> self-path import fix
  • http.js --> quiet catch on abort (removed console.warn)
  • index.d.cts --> add missing CanceledError readonly name

All 732 unit tests pass, lint clean. No breaking changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasonsaayman
Merge branch 'v1.x' into v1.x
d537120
@jasonsaayman jasonsaayman removed the status::changes-requested A reviewer requested changes to the PR label May 26, 2026
@jasonsaayman
jasonsaayman merged commit 73a7c55 into axios:v1.x May 26, 2026
26 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request May 27, 2026
[Vulnerability] axios/axios: Prototype Pollution 7azimo01/vulnerability-spoiler-alert#493
Open
jasonsaayman added a commit that referenced this pull request May 28, 2026
@Mohammad-Faiz-Cloud-Engineer @jasonsaayman
fix: clean up error handling, fix a proto-pollution gap, and seal a f…
be13430
…ew loose ends (#10922)

* Clean up error handling, fix a proto-pollution gap, and seal a few loose ends.

Been poking around the codebase and found a handful of things that needed tidying up:

- resolveConfig.js - config.params and config.paramsSerializer were being accessed directly off user input instead of going through the own() guard. If someone crafted a config with inherited params from the prototype, you'd get unexpected behavior. Swapped to own('params') / own('paramsSerializer') like the rest of the module does.

- http.js - there was a stray console.warn('emit error', err) in an abort-event catch block. Debug leftover, shouldn't reach production. Replaced with a quiet catch.

- AxiosHeaders.js - three places were throwing raw Error or TypeError instead of AxiosError. Swapped them over with ERR_BAD_OPTION_VALUE. Also added the missing AxiosError import (creates a circular dep with AxiosError.js which imports AxiosHeaders, but it works fine at runtime since the throws are inside method bodies, not at module eval time).

- toFormData.js - the circular reference detection was throwing a bare Error. Changed to AxiosError without a code, so it stays distinguishable from the depth-exceeded error that uses ERR_FORM_DATA_DEPTH_EXCEEDED. (There's a test that explicitly checks this distinction.)

- formDataToStream.js - two more raw throws (TypeError and Error) → AxiosError.

- buildURL.js - import self-path ../helpers/AxiosURLSearchParams.js when it lives in the same directory as the importer. Changed to ./AxiosURLSearchParams.js.

- index.d.cts - CanceledError was missing readonly name: 'CanceledError' that index.d.ts already has. Added it to keep the CJS declarations in sync.

Lint passes clean, all 770 unit tests green. Nothing breaking - all changes are either internal (no consumer-facing API change) or type-only.

* Update AxiosHeaders.js

* Update AxiosHeaders.js

* fix: revert breaking error-type changes per review feedback

Reverts AxiosError throws back to native Error/TypeError in AxiosHeaders,
formDataToStream, and toFormData to avoid breaking existing consumers
who catch by constructor name or check isAxiosError().

Adds regression tests for resolveConfig own('params')/own('paramsSerializer')
guard as requested in review.

Removes unused AxiosError imports from AxiosHeaders and formDataToStream.

* docs: add pre-release notes for config hardening

---------

Co-authored-by: Jason Saayman <[email protected]>
@pavlojs pavlojs mentioned this pull request Jun 15, 2026
deps(deps): bump the production-minor group across 1 directory with 2 updates whiteravens20/exemplar#88
Closed
@github-actions github-actions Bot mentioned this pull request Jul 20, 2026
Security vulnerabilities (automated scan) dam-agents/dam#2737
Closed
This was referenced Jul 22, 2026
GHSA-xj6q-8x83-jv6g (MEDIUM): detected in Lambda Docker Images. aws/aws-lambda-base-images#625
Closed
GHSA-xj6q-8x83-jv6g (MEDIUM): detected in Lambda Docker Images. the-lambda-watchdog/AWS-Lambda-Security-Reports#332
Closed
This was referenced Jul 23, 2026
chore(deps): update bruno to v3.5.3 uniget-org/tools#24342
Merged
chore(deps): update bruno to v4 uniget-org/tools#24383
Merged
@graviteeio graviteeio mentioned this pull request Jul 24, 2026
[4.10.x] chore: bump @gravitee/ui-components to 4.5.2 gravitee-io/gravitee-api-management#18736
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 5, 2026
feat(diagnosis): polish smart job explorer flow SkillBridgeExe/skillbridge-fe-official#177
Merged
@mnshchtri mnshchtri mentioned this pull request Aug 7, 2026
[Dependabot] axios: Axios: Prototype pollution auth subfields can inject Basic auth mnshchtri/infra-eye#74
Closed
@github-actions github-actions Bot mentioned this pull request Sep 1, 2026
chore(deps): update bruno to v4.1.0 uniget-org/tools#25971
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cubic-dev-ai cubic-dev-ai[bot] cubic-dev-ai[bot] left review comments
@jasonsaayman jasonsaayman jasonsaayman approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Mohammad-Faiz-Cloud-Engineer Mohammad-Faiz-Cloud-Engineer

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Mohammad-Faiz-Cloud-Engineer @jasonsaayman
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.