GHSA-gcfj-64vw-6mp9: Axios Node HTTP adapter can use an inherited proxy after interceptor config cloning
Axios’ Node.js HTTP adapter can route requests through an attacker-controlled proxy when Object.prototype.proxy is polluted and request configuration is materialized as a regular object before dispatch.
Recent axios releases harden merged request config by creating a null-prototype object. However, request interceptors run after that merge and may return a replacement config. A common immutable interceptor pattern such as {...config} or Object.assign({}, config) converts the hardened config back into a normal object. Axios then dispatches that object without re-hardening it, and the Node HTTP adapter reads config.proxy through the prototype chain.
Axios hardens merged request config by creating a null-prototype object, preventing polluted Object.prototype properties from influencing request behavior. Request interceptors run after that hardening, and a normal immutable interceptor pattern such as {…config} or Object.assign({}, config) re-materializes the config as a regular object. Axios then dispatches that interceptor-returned object without re-hardening it. In the Node HTTP adapter, config.proxy is read through the prototype chain, allowing a polluted Object.prototype.proxy to route authenticated HTTP requests through an attacker-controlled proxy.
References
- github.com/advisories/GHSA-gcfj-64vw-6mp9
- 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-gcfj-64vw-6mp9
Code Behaviors & Features
Detect and mitigate GHSA-gcfj-64vw-6mp9 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 →