Back to Blog
high SEVERITY4 min read

CVE-2026-42043: axios NO_PROXY Bypass via Malformed URL

CVE-2026-42043 is a high-severity vulnerability in axios where malformed URLs circumvent NO_PROXY environment variable protections, causing internal requests to route through attacker-controlled proxies. The fix upgrades axios from 1.13.6 to 1.18.0, introducing stricter proxy agent handling with `https-proxy-agent` and updated `follow-redirects`.

O
By Orbis AppSec
•Published September 30, 2026•Reviewed September 30, 2026

Answer Summary

axios versions through 1.13.6 are affected. An attacker can craft a URL that bypasses NO_PROXY settings, causing requests to internal services to be routed through an attacker-controlled proxy, exposing sensitive data. The fix upgrades axios to 1.18.0, which replaces `proxy-from-env` v1.1.0 with v2.1.0 and adds `https-proxy-agent` v5.0.1 for proper proxy exclusion handling. CWE unknown.

Vulnerability at a Glance

cweN/A
fixUpgrade to axios 1.18.0 with https-proxy-agent integration and stricter proxy-from-env v2.1.0
riskInternal service requests leaked through attacker-controlled proxies, exposing sensitive data and enabling SSRF amplification
languageJavaScript/TypeScript (Node.js)
root causeImproper URL parsing allowed malformed URLs to evade NO_PROXY pattern matching
vulnerabilityNO_PROXY bypass via crafted URL

Axios 1.13.6 NO_PROXY Bypass: When Environment Variables Fail

A crafted URL in axios 1.13.6 can trick the HTTP client into routing internal requests through an external proxy, even when NO_PROXY explicitly forbids it. CVE-2026-42043 exploits how axios parses destination URLs before checking them against proxy exclusion lists—malformed or unusually encoded hostnames slip past the pattern matcher, causing sensitive internal traffic to exit through infrastructure an attacker controls.

The vulnerability sits at the intersection of URL parsing and proxy configuration. Most developers trust that setting NO_PROXY=internal.api.company.com guarantees direct connections to that host. This finding proves that trust misplaced when the request URL carries unexpected encoding or structure.

Affected Versions

Affected <= 1.13.6
Fixed in 1.18.0
Ecosystem npm
CVE / GHSA CVE-2026-42043 / not assigned
CWE unknown

The Vulnerability Explained

The proxy selection logic in axios 1.13.6 relied on proxy-from-env v1.1.0 and follow-redirects v1.15.11 to determine whether a request should use a proxy. The critical flaw: URL parsing happened after proxy decision-making, or with insufficient normalization, allowing crafted URLs to present a different hostname to the proxy checker than the actual connection target.

Consider axios's dependency configuration in the vulnerable version:

"dependencies": {
  "follow-redirects": "^1.15.11",
  "form-data": "^4.0.5",
  "proxy-from-env": "^1.1.0"
}

An attacker constructing a request like axios.get('http://attacker.com%2f..%2finternal.api.company.com/path') could exploit parsing inconsistencies. The %2f encoded slashes might cause proxy-from-env's pattern matcher to see attacker.com (allowed through proxy) while the actual HTTP connection resolves to internal.api.company.com (supposed to be direct). This bypasses the defense-in-depth that NO_PROXY provides for internal service meshes.

The real-world impact is severe: microservice architectures commonly use NO_PROXY to ensure service-to-service calls stay within the VPC. A bypass exposes internal APIs, metadata endpoints (like EC2 IMDS), and administrative interfaces to external infrastructure.

The Fix

The remediation upgrades axios through a significant dependency restructuring:

Before (v1.13.6):

"axios": "^1.13.6"

After (v1.18.0):

"axios": "^1.18.0"

The resolved axios 1.18.0 introduces three critical changes:

  1. https-proxy-agent v5.0.1 added — a new dependency that centralizes proxy handling with strict URL validation before any proxy selection occurs
  2. follow-redirects upgraded to ^1.16.0 — cleaner separation between redirect resolution and proxy routing
  3. proxy-from-env upgraded to ^2.1.0 — stricter hostname normalization and CIDR matching for NO_PROXY patterns

The lockfile reveals the structural shift:

"dependencies": {
  "follow-redirects": "^1.16.0",
  "form-data": "^4.0.5",
  "https-proxy-agent": "^5.0.1",
  "proxy-from-env": "^2.1.0"
}

The addition of agent-base (required by https-proxy-agent) provides the foundation for proper URL canonicalization. Now when axios prepares a request, https-proxy-agent validates and normalizes the target URL before proxy-from-env evaluates it against NO_PROXY patterns. The encoded-slash bypass and similar techniques fail because the URL is decoded and canonicalized early in the pipeline.

Key Takeaways

  • Proxy exclusion logic must normalize before matching: NO_PROXY checks against raw URL strings invite bypasses; canonicalize hostnames first.
  • Dependency upgrades can rearchitect security-critical paths: The fix isn't a one-line patch but a restructuring of how axios handles proxy agents.
  • follow-redirects versions matter for proxy security: Redirect handling and proxy selection interact in subtle ways; keep both updated.
  • Environment-variable-based security controls need defense in depth: NO_PROXY alone is insufficient; validate at the application layer where possible.
  • Encoded characters in URLs are an attack surface: Any parsing that treats %2f differently from / creates opportunities for parser differential attacks.

How Orbis AppSec Detected This

Source: The url parameter passed to axios.request(), axios.get(), or any axios HTTP method, accepting user-influenced or externally fetched URLs.

Sink: The proxy selection logic within axios's internal request pipeline, specifically where proxy-from-env evaluates URLs against NO_PROXY patterns without prior canonicalization.

Missing control: URL normalization before proxy exclusion matching; the absence of https-proxy-agent or equivalent strict parsing allowed malformed URLs to evade pattern checks.

CWE: unknown (proxy/relay misconfiguration variant)

Fix: Upgrade axios to 1.18.0, which introduces https-proxy-agent for strict URL validation and updates proxy-from-env to v2.1.0 with improved hostname matching.

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

CVE-2026-42043 demonstrates that even mature HTTP clients can mishandle the boundary between URL parsing and security policy enforcement. The axios upgrade to 1.18.0 closes this bypass by restructuring proxy handling around https-proxy-agent's stricter validation. For teams running axios in microservice environments, this isn't a theoretical concern—it's a direct protection against internal service exposure.

Prevention and further reading

Frequently Asked Questions

Does axios 1.18.0's addition of `https-proxy-agent` change how proxy configurations are validated?

Yes. The new `https-proxy-agent` dependency enforces stricter URL parsing before proxy selection, ensuring NO_PROXY patterns match against canonicalized hostnames rather than raw URL strings.

Why does upgrading `follow-redirects` from 1.15.11 to 1.16.0 matter for this vulnerability?

The redirect-following logic interacts with proxy selection; the updated version provides cleaner separation between redirect targets and proxy routing decisions, preventing malformed redirect URLs from polluting proxy exclusion checks.

Does `proxy-from-env` v2.1.0 handle NO_PROXY patterns differently than v1.1.0?

Yes. Version 2.1.0 implements stricter hostname normalization and CIDR block matching, closing the parsing edge cases that allowed crafted URLs to slip past NO_PROXY exclusions.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #14

Related Articles

critical

Cloudflare Worker Reverse Proxy SSRF via String Concatenation

A Cloudflare Worker reverse proxy built its upstream request URL by string-concatenating an environment variable with the incoming request's pathname and search string, letting a crafted path or query redirect requests to attacker-chosen hosts. The fix replaces concatenation with the `URL` object's `pathname` and `search` setters, which normalize input against the configured origin instead of blindly appending it.

high

fast-uri 3.1.2 IDN Host Bypass: CVE-2026-13676 Upgrade

A dependency tree in this repository resolved `fast-uri` 3.1.2, a version affected by CVE-2026-13676, in which improper Unicode hostname canonicalization lets a crafted URI parse to one host while the HTTP client connects to another. Because `fast-uri` is what `ajv` uses to parse and resolve URIs for `format: "uri"` validation and `$ref` resolution, any host allowlist built on its parsed output could be bypassed. The fix upgrades the resolved copy to `fast-uri` 4.1.4 and pins it with an npm `ove

high

boardcards.js parseArgs() SSRF: --board Flag Reaches Metadata IPs

The `parseArgs()` function in boardcards.js accepted a user-controlled `--board` command-line argument and passed it directly to fetch() calls without validating the URL scheme or hostname. An attacker could supply `http://169.254.169.254/latest/meta-data/` or other internal addresses to extract cloud credentials or scan internal networks.

high

fetch() with Automatic Redirects Leaks HTTPS Trust to api.tomys.top

The `withProxy()` fetch wrapper allowed automatic HTTP redirects from `api.tomys.top`, trusting the external API's domain integrity without validating final destinations. A compromised or malicious redirect response could send users to attacker-controlled phishing sites while maintaining HTTPS protocol and hostname checks that falsely appear secure.

high

Meta.get() Honored @uploadURL From Script Headers: SSRF Fix

A userscript manager's metadata parser accepted the `@uploadURL` directive from a script's own header block, so any installed or auto-updated script could silently redirect the options-page `uploadScript()` fetch to an attacker-chosen destination — including loopback, link-local metadata endpoints, and LAN addresses. The fix makes `Meta.get()` ignore `@uploadURL` when it appears in a script header, leaving the User Metadata field (validated in `Meta.getUserMeta()`) as the only way to set it, and

high

image-size 1.2.1 DoS: Zero-Valued Dimensions in Image Buffer Parser

A high-severity denial-of-service vulnerability in image-size 1.2.1 allows attackers to crash Node.js services using malicious image buffers with zero-valued dimensions. The fix removes the vulnerable `queue` dependency and tightens dimension validation in version 2.0.3.