Details
Results:
- Test 1:
127.0.0.1 + NO_PROXY=localhost→ BYPASS (correct) - Test 2:
0.0.0.0 + NO_PROXY=localhost→ VIA_PROXY (SSRF) - Test 3:
[::] + NO_PROXY=localhost→ VIA_PROXY (SSRF) - Test 4:
[::ffff:0.0.0.0] + NO_PROXY=localhost→ VIA_PROXY (SSRF)
Phase 3: Actual Axios Client
The real Axios HTTP client (v1.16.1, source tree) was tested through proxy configuration:
- Axios with
proxy: { host: 'proxy', port: 8888 } - Setting
NO_PROXY=localhostand requestinghttp://0.0.0.0:9999/ - Result: Axios forwarded the request through the proxy instead of bypassing it
4. Impact
Attack Scenario
- Attacker has control over a URL that an Axios client will request (direct input, redirect target, open redirect chain)
- The Axios client is configured with a proxy (e.g., corporate proxy) and
NO_PROXY=localhostto protect internal services - Attacker supplies
http://0.0.0.0:8080/adminas the target URL - Axios sends the request through the proxy
- The proxy resolves
0.0.0.0→ the proxy's own loopback → reaches the internal admin service on port 8080
Potential Consequences
- Information disclosure (C:L): Internal service responses become accessible
- Integrity impact (I:L): Attacker can trigger actions on internal services (if proxy supports PUT/POST/DELETE)
- Availability impact (A:L): Limited — depends on internal service behavior
Likelihood
- High — proxy bypass is a common pattern in microservice architectures
- Medium — requires attacker control of a URL (not always available)
5. Remediation
Code Fix
File: lib/helpers/shouldBypassProxy.js
function isIPv4Loopback(host) {
if (host === '0.0.0.0') return true; // ADD THIS LINE
const parts = host.split('.');
if (parts.length !== 4) return false;
if (parts[0] !== '127') return false;
return parts.every(p => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
}
function isIPv6Loopback(host) {
if (host === '::1' || host === '::') return true; // ADD '::'
// ... rest of implementation
}
Workarounds
- Add
0.0.0.0and::to theNO_PROXYenvironment variable explicitly - Use
127.0.0.1instead of0.0.0.0in all internal service URLs - Implement URL validation to reject
0.0.0.0and::before passing to Axios