Vulnerability DatabaseGHSA-g987-ghpm-49w8

GHSA-g987-ghpm-49w8: 
JavaScript vulnerability analysis and mitigation

Summary

In Axios 0.19.0–0.34.0 and 1.0.0–1.20.0 (fixed in 0.35.0 and 1.21.0), the Node HTTP adapter can send requests through an environment-configured proxy even when NO_PROXY names the destination using an equivalent Unicode IDN or expanded IPv6 form. The Unicode IDN case affects the whole range; the expanded IPv6 case is specific to 0.31.0–0.34.0 and 1.15.0–1.20.0, because earlier releases matched no IPv6 entry at all. The request URL is canonicalized before comparison, while the bypass entry is only partly normalized. A less-trusted or attacker-observable proxy can therefore receive traffic the operator intended to keep direct. No fixed release was verified at review time.

Impact

The issue applies when Axios manages an environment proxy, NO_PROXY contains a noncanonical equivalent of the destination hostname, and a request reaches that destination. For plain HTTP, the selected proxy can read the request URL, headers, and body and can supply a response. In 0.x and Axios 1.15.0–1.16.0, HTTPS over an HTTP proxy uses forward-proxy mode rather than CONNECT: a local reproduction on 0.33.0 showed the proxy receiving an https:// absolute URL and a dummy Authorization header in plaintext, then supplying the response accepted by Axios. Axios 1.16.1 and later 1.x use CONNECT and origin TLS for HTTPS, so that proxy ordinarily sees destination/connection metadata rather than HTTPS headers or body unless TLS or the transport is separately compromised. The proxy must be less trusted or attacker-observable for a confidentiality or integrity attack. An application URL allowlist, a trusted proxy, or a proxy that refuses the destination can limit impact. This is a Node HTTP-adapter runtime issue; browser/XHR and fetch-adapter requests do not call this helper. This report does not independently establish direct access to internal services or a bypass of an application-level destination allowlist.

Affected Functionality

Environment-derived proxy selection in lib/adapters/http.js and plain-host matching in lib/helpers/shouldBypassProxy.js, using HTTP_PROXY/HTTPS_PROXY with NO_PROXY/no_proxy. Affected entries include a Unicode spelling of an IDN whose URL hostname becomes Punycode and an expanded IPv6 spelling whose URL hostname becomes compressed. Explicit caller-provided config.proxy is a separate trusted configuration path. Node-native environment proxy agents and custom transports may have different matching behavior and were not assessed as this helper path.

Technical Details

shouldBypassProxy(location) parses the destination with new URL(location). That yields xn--bcher-kva.example for bücher.example and a compressed hostname for [2001:0db8:0:0:0:0:0:1]. normalizeNoProxyHost() removes selected syntax such as brackets and trailing dots, and later releases normalize selected IPv4 forms, but ordinary NO_PROXY host entries are not converted to IDNA ASCII or canonical IPv6. The resulting strings compare unequal. The proxy-from-env dependency also compares against the canonical URL hostname, returns the environment proxy, and Axios's setProxy() applies it when the helper returns false. The 1.x transport boundary matters: 1.16.0 forwards proxied HTTPS requests in the proxy path, while 1.16.1 introduces HttpsProxyAgent tunneling. The 0.34.0 adapter retains the forward-proxy path.

Proof of Concept of Attack

Safe helper controls, with no external network connection, against checked tags:

NO_PROXY=bücher.example             URL=http://bücher.example/       bypass=false
NO_PROXY=xn--bcher-kva.example      URL=http://bücher.example/       bypass=true
NO_PROXY=2001:0db8:0:0:0:0:0:1      URL=http://[2001:db8::1]/      bypass=false
NO_PROXY=2001:db8::1                URL=http://[2001:db8::1]/      bypass=true

These results were reproduced on 0.31.0, 0.31.1, 0.33.0, 0.34.0, 1.15.0, 1.15.1, 1.18.1, and 1.20.0. A loopback-only proxy/target test on 0.33.0 returned target with NO_PROXY=::1 and proxy with NO_PROXY=0:0:0:0:0:0:0:1 for the same http://[::1] URL. A separate loopback proxy test with HTTPS_PROXY, NO_PROXY=bücher.example, and https://bücher.example/path recorded the dummy Authorization: Bearer local-test-marker header and supplied the accepted response. No real credentials or external services were used.

Workarounds

Write IDN NO_PROXY entries as ASCII/Punycode and IPv6 entries in the URL parser's compressed form, then test the actual runtime route. For requests that must be direct, use proxy: false with an agent that does not independently apply Node-native environment proxying; retain a destination allowlist where URLs can be influenced by untrusted input. <details> <summary><h3>Original report</h3></summary>

Summary

Axios 1.18.1 canonicalizes request URL hostnames through the WHATWG URL API, but applies only partial normalization to NO_PROXY entries. Equivalent Unicode/Punycode domain names and expanded/compressed IPv6 literals can compare unequal. Axios then routes an HTTP request through a configured proxy even though the operator explicitly excluded the destination. A less-trusted proxy can receive the full HTTP URL, headers, credentials, and body, or originate the request from a different network boundary. I reviewed revision a092bae50d1884782151b2fcea12974d6da6e376 and reproduced both variants locally against the published axios@1.18.1 package. I did not test a public or production service.

Details

_The Node HTTP adapter calls shouldBypassProxy(location) before activating an environment proxy (lib/adapters/http.js:249-257):

const proxyUrl = getProxyForUrl(location);
if (proxyUrl) {
  if (!shouldBypassProxy(location)) {
    proxy = new URL(proxyUrl);
  }
}

The request side has already passed through new URL(location), which converts IDNs to Punycode and serializes IPv6 into compressed form. However, normalizeNoProxyHost() at lib/helpers/shouldBypassProxy.js:253-271 only strips brackets/trailing dots, normalizes selected IPv4 forms, and unmaps IPv4-mapped IPv6:

const normalizeNoProxyHost = (hostname) => {
  if (!hostname) return hostname;
  if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') {
    hostname = hostname.slice(1, -1);
  }
  const trimmed = hostname.replace(/\.+$/, '');
  const ipv4 = normalizeIPAddress(trimmed);
  if (ipv4 !== trimmed) return ipv4;
  return unmapIPv4MappedIPv6(trimmed);
};

At lib/helpers/shouldBypassProxy.js:296-327, Axios compares the canonical URL hostname with the partially normalized entry:

const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
// ...
entryHost = normalizeNoProxyHost(entryHost);
return hostname === entryHost || (isLoopback(hostname) && isLoopback(entryHost));

We therefore reach these false comparisons:

FamilyRequest hostnameNO_PROXY entryResult
IDNxn--bcher-kva.examplebücher.exampleno match
IPv62001:db8::12001:0db8:0:0:0:0:0:1no match
Finding ID: AXIOS-NOPROXY-CANON-001
Finding fingerprint: csf_836b19673d39cb26827b527e

PoC

Create an empty directory with the following package.json:

{
  "private": true,
  "type": "module",
  "scripts": {"test": "node poc.mjs"},
  "dependencies": {"axios": "1.18.1"}
}

Save the following as poc.mjs:

import http from 'node:http';
import axios from 'axios';
const hits = [];
const proxy = http.createServer((req, res) => {
  hits.push(req.url);
  res.end('proxy');
});
await new Promise((resolve) => proxy.listen(0, '127.0.0.1', resolve));
const keys = ['HTTP_PROXY', 'http_proxy', 'HTTPS_PROXY', 'https_proxy',
  'ALL_PROXY', 'all_proxy', 'NO_PROXY', 'no_proxy'];
const original = Object.fromEntries(keys.map((key) => [key, process.env[key]]));
const proxyURL = `http://127.0.0.1:${proxy.address().port}`;
process.env.HTTP_PROXY = process.env.http_proxy = proxyURL;
process.env.HTTPS_PROXY = process.env.https_proxy = '';
process.env.ALL_PROXY = process.env.all_proxy = '';
async function run(name, noProxy, url) {
  process.env.NO_PROXY = process.env.no_proxy = noProxy;
  const before = hits.length;
  try {
    const response = await axios.get(url, {timeout: 800});
    return {name, status: response.status, proxied: hits.length > before};
  } catch (error) {
    return {name, code: error.code || error.name, proxied: hits.length > before};
  }
}
try {
  const results = [
    await run('idn-control', 'xn--bcher-kva.example', 'http://bücher.example/'),
    await run('idn-bypass', 'bücher.example', 'http://bücher.example/'),
    await run('ipv6-control', '2001:db8::1', 'http://[2001:db8::1]/'),
    await run('ipv6-bypass', '2001:0db8:0:0:0:0:0:1', 'http://[2001:db8::1]/')
  ];
  console.log(JSON.stringify({version: axios.VERSION, results, hits}, null, 2));
} finally {
  for (const key of keys) {
    if (original[key] === undefined) delete process.env[key];
    else process.env[key] = original[key];
  }
  await new Promise((resolve) => proxy.close(resolve));
}

Run:

npm install
npm test

The canonical IDN and IPv6 controls do not reach the proxy. The equivalent Unicode IDN and expanded IPv6 entries do reach it and return HTTP 200. The PoC uses only a loopback proxy, .example, and the 2001:db8::/32 documentation prefix.

Impact

This is a NO_PROXY policy bypass / SSRF-class routing issue. Exploitation requires a configured HTTP proxy, an attacker-influenced outbound URL, an equivalent non-canonical NO_PROXY entry, and no independent destination rejection. For HTTP destinations, the proxy can observe the request and its credentials/body. For HTTPS CONNECT, origin TLS normally reduces disclosure. Proposed severity: Medium, CVSS 3.1 score 6.8. </details>


Source: NVD

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-wwgw-vggh-5g74HIGH8.3
  • JavaScript logoJavaScript
  • axios
NoYesNov 24, 2026
GHSA-g987-ghpm-49w8HIGH8.3
  • JavaScript logoJavaScript
  • axios
NoYesNov 24, 2026
GHSA-37m8-qm4g-gxcgHIGH8.3
  • JavaScript logoJavaScript
  • axios
NoYesNov 24, 2026
GHSA-9wvp-77p3-9wf3HIGH7.6
  • JavaScript logoJavaScript
  • @copilotkit/runtime
NoYesNov 24, 2026
GHSA-8899-x9g3-4xgrMEDIUM5.3
  • JavaScript logoJavaScript
  • payload
NoYesNov 24, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management