GHSA-7q8q-rj6j-mhjq: Axios: Nested axios option objects can consume polluted prototype values
Axios can consume inherited properties from nested request option objects when the JavaScript process already has a polluted Object.prototype.
The top-level merged config is protected with a null prototype, but nested plain objects such as auth and paramsSerializer are cloned into ordinary objects. If application code passes placeholders such as auth: {} or paramsSerializer: {}, inherited username, password, encode, or serialize properties can influence outbound requests.
axios 1.16.1 mitigates prototype-pollution gadgets on the top-level request config but not on nested option objects. When a caller passes a partial nested option object such as auth: {} or paramsSerializer: {}, axios reads inner fields (username, password, encode, serialize) through the prototype chain. If Object.prototype has been polluted by another component in the same Node.js process, those inherited values are silently injected into the outbound request, including the Authorization header and the serialized query string.
References
- github.com/advisories/GHSA-7q8q-rj6j-mhjq
- github.com/axios/axios/commit/1417285c69344bbcc6420a021f67dee0c6fedb2d
- github.com/axios/axios/commit/32fc489632377d214db55bfa4e2c48486a7d7ce2
- github.com/axios/axios/pull/11000
- github.com/axios/axios/pull/11001
- github.com/axios/axios/releases/tag/v0.33.0
- github.com/axios/axios/releases/tag/v1.18.0
- github.com/axios/axios/security/advisories/GHSA-7q8q-rj6j-mhjq
Code Behaviors & Features
Detect and mitigate GHSA-7q8q-rj6j-mhjq with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →