/

CVE-2025-62718

Severity:

CRITICAL RISK

(9.9)

Improper Access Control / Proxy Bypass in Axios HTTP Client

CVE-2025-62718

Modified

Vulnerability type

Category:

Improper Access Control / Proxy Bypass

CWE:

CWE-441, CWE-918, CWE-1289

Impact:

Proxy Bypass and Server-Side Request Forgery (SSRF)

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Axios, a popular HTTP client for browsers and Node.js, incorrectly handles hostname normalization when applying NO_PROXY rules, especially for loopback addresses like localhost. (with a trailing dot) and [::1].

Under certain hostname formats, requests that developers expect to bypass the proxy instead get routed through it, enabling proxy bypass and potential SSRF attacks against loopback or internal services despite NO_PROXY protections.

Affected context

This vulnerability affects applications that:

  • Use Axios (prior to 1.15.0 and 0.31.0) as an HTTP client in Node.js or browser environments, and
  • Rely on NO_PROXY (or equivalent) configuration to prevent sensitive loopback or internal hosts from being accessed via a proxy.

The issue appears when Axios evaluates whether a target host should bypass the proxy based on NO_PROXY entries. Due to incomplete hostname normalization, certain syntactic variants of loopback addresses (for example localhost. or [::1]) are not matched against NO_PROXY, causing traffic that should be direct to instead flow through the configured proxy.

Exploit preconditions

  • Attack surface: Any Axios-based HTTP request where the destination URL can be influenced by an attacker, such as:
  • User-controlled URLs in backend services (e.g., webhooks, URL previews, metadata fetchers)
  • Indirectly controlled endpoints in microservices or integration layers
  • Required access: Ability to inject or control all or part of the request URL (including hostname) used by Axios within a process that has a proxy configured and NO_PROXY set for internal or loopback addresses.
  • Trigger point: The moment Axios evaluates NO_PROXY rules and decides whether a given request (e.g., to http://localhost.:port or http://[::1]/) should be proxied or sent directly.
  • Why exploitation is possible: Axios performs NO_PROXY matching on hostnames that are not fully normalized to their canonical representations. Variant hostnames that still resolve to loopback or internal addresses evade NO_PROXY matching and are sent through the proxy, contradicting configuration intent and undermining trust boundaries around internal services.

Why this happens

The core issue is an improper access control decision during proxy-bypass checks, rooted in hostname normalization and comparison logic.

Axios relies on NO_PROXY entries to decide whether certain hosts should bypass the proxy (typically loopback or internal services). However, the implementation does not normalize hostnames and IP literals into a canonical form before applying matching rules. As a result:

  • Syntactic variants like localhost. (with a trailing dot) or IPv6 literals like [::1] are treated as distinct from their more common representations (localhost, ::1).
  • NO_PROXY patterns that were configured to protect loopback or internal hosts fail to match these variants.

This maps to:

  • CWE-441: Unintended Proxy or Intermediary — access control decisions about the use of a proxy are made incorrectly, allowing traffic to traverse an intermediary against configuration intent.
  • CWE-918: Server-Side Request Forgery (SSRF) — an attacker can leverage the HTTP client to make requests to otherwise protected loopback or internal endpoints.

Abstractly, the bug is an instance of inconsistent input normalization before security decisions: security policies (NO_PROXY rules) are applied to one representation of hostnames, while the actual network behavior and resolution treat multiple syntactic forms as equivalent, creating a discrepancy attackers can exploit.

Potential impact

  • Requests that developers intended to keep off the proxy (e.g., localhost, internal hostnames) can be routed through the configured proxy.
  • Attackers may coerce backend services into making SSRF requests to:
  • Loopback-only admin endpoints
  • Cloud metadata services
  • Internal microservices or management interfaces
  • Exposure of sensitive internal APIs or configuration data reachable only from loopback or internal networks.
  • Potential escalation from SSRF to:
  • Credential theft (e.g., tokens from metadata services)
  • Unauthorized administration actions on internal services
  • Pivoting deeper into private network segments via the proxy.
  • Violation of network segmentation assumptions and defense-in-depth models that depend on NO_PROXY honoring internal hosts.

General mitigation guidance

Mitigation focuses on ensuring consistent hostname handling and defensive network boundaries around HTTP clients:

  • Normalize hostnames before policy checks:
  • Apply canonicalization of hostnames and IP literals (e.g., remove trailing dots, normalize IPv6 notation) before evaluating NO_PROXY or equivalent rules.
  • Standardize on a common representation of loopback and internal hosts in application-level checks.
  • Strengthen NO_PROXY and proxy-handling logic:
  • Treat loopback and link-local ranges as protected by default in higher-level request wrappers, regardless of NO_PROXY configuration.
  • Implement a deny-by-default list for sensitive destinations (e.g., 127.0.0.0/8, ::1, metadata service addresses) that bypasses proxy usage and rejects untrusted input outright.
  • Reduce trust in user-controlled URLs:
  • Avoid directly passing unvalidated, user-supplied URLs to Axios. Instead, validate and constrain:
  • Allowed schemes (e.g., restrict to https),
  • Hostnames and IP ranges (disallow localhost, private IPs, and metadata endpoints for untrusted contexts),
  • Ports and paths where applicable.
  • Enforce network-level segmentation:
  • Place sensitive loopback or internal services behind network controls rather than relying solely on NO_PROXY for protection.
  • Use firewall rules, container networking policies, or service meshes to block unwanted egress to internal-only endpoints.
  • Apply least privilege to proxies:
  • Limit the proxy's ability to reach internal or administrative networks where feasible.
  • Separate proxies used for external traffic from those that have access to sensitive internal services.

How teams detect issues like this

Detection can leverage both code-level and operational insights:

  • Static analysis and code review:
  • Flag locations where Axios is invoked with URLs influenced by external input (e.g., request parameters, headers, body fields).
  • Look for reliance on NO_PROXY as the sole mechanism guarding access to loopback or internal endpoints.
  • Review any URL-normalization utilities and ensure they are applied before security-related hostname checks.
  • Configuration and policy auditing:
  • Inventory services that configure Axios with proxies and NO_PROXY settings, especially those handling user-supplied URLs.
  • Check for assumptions in documentation or comments that "NO_PROXY protects localhost/internal services" and treat them as potential risk indicators.
  • Runtime and network monitoring:
  • Monitor proxy logs for unexpected requests targeting loopback or internal-only hostnames and IP ranges.
  • Use anomaly detection on outbound HTTP traffic patterns from backend services, focusing on requests originating from components that should not reach internal endpoints via the proxy.
  • Automated tooling:
  • Integrate security scanners or linters into CI/CD that:
  • Identify Axios usage with proxy settings.
  • Highlight missing hostname normalization or insufficient SSRF protections.
  • Employ dynamic security testing to fuzz URL inputs and observe whether loopback/internal routes become accessible via the proxy.

Sources

SourceLink
datatracker.ietf.orgdatatracker.ietf.org/doc/html/rfc1034#section-3.1
datatracker.ietf.orgdatatracker.ietf.org/doc/html/rfc3986#section-3.2.2
github.comgithub.com/axios/axios/commit/03cdfc99e8db32a390e12128208b6778492cee9c
github.comgithub.com/axios/axios/commit/fb3befb6daac6cad26b2e54094d0f2d9e47f24df
github.comgithub.com/axios/axios/pull/10661
github.comgithub.com/axios/axios/pull/10688
github.comgithub.com/axios/axios/releases/tag/v0.31.0
github.comgithub.com/axios/axios/releases/tag/v1.15.0
github.comgithub.com/axios/axios/security/advisories/GHSA-3p68-rc4w-qgx5
access.redhat.comaccess.redhat.com/errata/RHSA-2026:10175
access.redhat.comaccess.redhat.com/errata/RHSA-2026:13571
access.redhat.comaccess.redhat.com/errata/RHSA-2026:13826
access.redhat.comaccess.redhat.com/errata/RHSA-2026:14937
access.redhat.comaccess.redhat.com/errata/RHSA-2026:16874
access.redhat.comaccess.redhat.com/errata/RHSA-2026:17657
access.redhat.comaccess.redhat.com/errata/RHSA-2026:17699
access.redhat.comaccess.redhat.com/errata/RHSA-2026:19375
access.redhat.comaccess.redhat.com/errata/RHSA-2026:19712
access.redhat.comaccess.redhat.com/errata/RHSA-2026:20889
access.redhat.comaccess.redhat.com/errata/RHSA-2026:20938
access.redhat.comaccess.redhat.com/errata/RHSA-2026:21017
access.redhat.comaccess.redhat.com/errata/RHSA-2026:22465
access.redhat.comaccess.redhat.com/errata/RHSA-2026:22629
access.redhat.comaccess.redhat.com/errata/RHSA-2026:22840
access.redhat.comaccess.redhat.com/errata/RHSA-2026:23361
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24471
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24761
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24766
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24853
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24866
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24977
access.redhat.comaccess.redhat.com/errata/RHSA-2026:26010
access.redhat.comaccess.redhat.com/errata/RHSA-2026:36882
access.redhat.comaccess.redhat.com/errata/RHSA-2026:41928
access.redhat.comaccess.redhat.com/errata/RHSA-2026:59155
access.redhat.comaccess.redhat.com/errata/RHSA-2026:8483
access.redhat.comaccess.redhat.com/errata/RHSA-2026:8484
access.redhat.comaccess.redhat.com/errata/RHSA-2026:8490
access.redhat.comaccess.redhat.com/errata/RHSA-2026:8491
access.redhat.comaccess.redhat.com/errata/RHSA-2026:8493
access.redhat.comaccess.redhat.com/errata/RHSA-2026:9742
access.redhat.comaccess.redhat.com/security/cve/CVE-2025-62718
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2456913
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-62718.json

Frequently asked

questions

Yes, it can be, if an attacker can influence the URLs that an Axios-using service requests. In typical scenarios, remote attackers supply crafted URLs (for example via webhooks or URL parameters), which are then requested by a backend using Axios with a proxy configured, allowing proxy bypass and potential SSRF.

It depends on the application context. If the URL input surface is accessible without authentication (e.g., a public webhook endpoint), no authentication is required. Where URL inputs are behind login or API keys, an attacker would need the corresponding level of access but does not require local system access.

The safest pattern is to combine accurate hostname normalization with strict SSRF protections: normalize hostnames before comparing them against NO_PROXY or allow/deny lists, explicitly block loopback and internal destinations for untrusted URL inputs, and avoid relying solely on proxy configuration to protect internal services.

Treat proxy and NO_PROXY behavior as part of your security model, not just connectivity configuration. Enforce canonicalization before security decisions, adopt a deny-by-default stance for internal and loopback hosts in HTTP clients, implement centralized SSRF defenses (such as URL validation and egress filtering), and include automated checks in your review pipelines to catch unsafe HTTP client usage early.

Find out what's already
exploitable in your codebase.