
Cloud Vulnerability DB
A community-led vulnerabilities database
In Axios 0.31.0 through 0.34.0 (fixed in 0.35.0), proxy-from-env@1.1.0 can select a proxy from npm_config_http_proxy while Axios’s shouldBypassProxy helper reads only no_proxy and NO_PROXY. An npm-style bypass entry in npm_config_no_proxy is therefore not applied to an equivalent loopback name such as localhost.. Older 1.x releases also route this case through a proxy, but do not contain the Axios helper and have a different root cause.
In a deployment relying on npm-style proxy variables and a bypass list for loopback/internal HTTP services, the unintended proxy can receive full request credentials and return a response. The issue is conditional on the proxy variable actually being honored. Newer 1.x releases using proxy-from-env@2.1.0 do not select npm_config_http_proxy at all; they may instead surprise operators who expected npm-style proxy support.
Node HTTP adapter setProxy, proxy-from-env@1.1.0, and on 0.34.0 specifically lib/helpers/shouldBypassProxy.js; npm_config_http_proxy, npm_config_no_proxy, and URL host normalization for loopback-equivalent names.
On 0.34.0 the dependency selects the npm-style proxy, while Axios’s helper reads only ordinary no_proxy/NO_PROXY. On 1.12.0 and 1.13.6 there is no Axios helper; the older dependency’s own exact host check fails to equate localhost. with localhost. With a local proxy and target, npm_config_http_proxy=<local proxy> and npm_config_no_proxy=localhost sent http://localhost.:<target-port>/ to the proxy on all three releases. The same test on 1.20.0 reached the target because proxy-from-env@2.1.0 ignores npm_config_http_proxy altogether.
Run one local HTTP target and proxy. Clear ordinary proxy variables; set only npm_config_http_proxy=http://127.0.0.1:<proxy-port> and npm_config_no_proxy=localhost. Send axios.get("http://localhost.:<target-port>/"). On 0.34.0 with its declared proxy-from-env@1.1.0, the proxy answers instead of the target. Repeat with 1.20.0 and its declared 2.1.0 dependency as a non-proxy control.
Use the ordinary HTTP_PROXY/NO_PROXY variables supported by both Axios’s matching helper and the selected proxy dependency, or set proxy:false with an agent known not to use Node native proxying for the specific request.
<details>
<summary><h3>Original report</h3></summary>
CVE-2025-62718: Axios does not consistently apply NO_PROXY bypass rules when proxy settings are provided through npm-style environment variables. Requests to loopback-equivalent hosts such as localhost. and [::1] correctly bypass the proxy with no_proxy / NO_PROXY, but still go through the proxy when using npm_config_http_proxy together with npm_config_no_proxy.
This can cause loopback or internal-service requests to cross an unintended proxy boundary.
For CVE-2025-62718, Axios has logic to decide whether a request should bypass a configured proxy. The latest commit correctly handles these configurations:
http_proxy + no_proxy
HTTP_PROXY + NO_PROXYHowever, Axios still honors this variable when selecting a proxy:
npm_config_http_proxybut its bypass logic does not honor the corresponding bypass variable:
npm_config_no_proxySo a proxy can be enabled by npm_config_http_proxy, while npm_config_no_proxy=localhost,127.0.0.1,::1 is ignored. As a result, requests to http://localhost./... and http://[::1]/... are sent through the proxy even though they should be bypassed.
The incomplete logic is in lib/helpers/shouldBypassProxy.js, where the code checks no_proxy / NO_PROXY but not npm_config_no_proxy / NPM_CONFIG_NO_PROXY.
Run a request with these environment variables:
export npm_config_http_proxy=http://127.0.0.1:8080
export npm_config_no_proxy=localhost,127.0.0.1,::1Then send Axios requests to loopback-equivalent hosts:
import axios from './index.js';
await axios.get('http://localhost./test');
await axios.get('http://[::1]/test');Expected behavior: both requests should bypass the proxy because localhost and ::1 are listed in npm_config_no_proxy.
Observed behavior on the latest commit: both requests are sent through the configured proxy. In other words, npm_config_http_proxy is honored when selecting the proxy, but npm_config_no_proxy is not honored when deciding whether to bypass it.
For comparison, the same loopback-equivalent requests are bypassed as expected when the bypass list is provided through ordinary no_proxy or NO_PROXY.
A fix that makes shouldBypassProxy also read npm_config_no_proxy prevents these requests from using the configured proxy.
Applications that rely on Axios proxy bypass rules may be affected by this incomplete fix for CVE-2025-62718 if they configure proxies through npm-style environment variables. The demonstrated affected configuration is:
npm_config_http_proxy=<proxy URL>
npm_config_no_proxy=localhost,127.0.0.1,::1Under this configuration, requests to loopback-equivalent hosts such as localhost. and [::1] may still be routed through the proxy. This can weaken SSRF or internal-network protections that depend on NO_PROXY behavior.
</details>
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."