Executive brief
Axios is a popular library used by developers to make web requests. A security issue exists where, if an application is already vulnerable to a separate 'prototype pollution' flaw, an attacker can trick Axios into including incorrect or malicious login credentials in outgoing web requests. This could lead to unauthorized access to third-party services or cause legitimate requests to fail.
Technical details
Axios versions 1.15.2 through 1.17.x contain a read-side prototype pollution gadget in the handling of Basic Authentication subfields. While Axios hardened its top-level configuration against prototype pollution, nested objects like 'auth' still inherit from Object.prototype. If an attacker can pollute Object.prototype.username or Object.prototype.password, and the application makes an Axios request with an empty or partial 'auth' object (e.g., auth: {}), Axios will read the polluted values from the prototype chain. This allows an attacker to inject arbitrary Basic auth headers into outbound requests. The vulnerability affects both the Node.js HTTP adapter and the browser/fetch shared resolver. A fix was introduced in version 1.18.0 by implementing hasOwnProp checks for auth subfields.
Affected products
- axios axios >= 1.15.2, < 1.18.0
Timeline
- 2026-07-06: advisory: Initial GitHub Advisory published
- 2026-07-20: patched: Advisory updated to reflect patched version 1.18.0