Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-54793

CVE-2025-54793: Astro Web Framework Open Redirect Flaw

CVE-2025-54793 is an open redirect vulnerability in Astro web framework affecting versions 5.2.0 to 5.12.7. Attackers can redirect users to malicious domains via crafted URLs. This article covers technical details, impact, and fixes.

Published:

CVE-2025-54793 Overview

CVE-2025-54793 is an open redirect vulnerability [CWE-601] in the Astro web framework, affecting versions 5.2.0 through 5.12.7. The flaw resides in the trailing slash redirection logic when handling paths that contain double slashes. Attackers can craft URLs such as https://mydomain.com//malicious-site.com/ to redirect users to arbitrary external domains. The issue only affects sites using on-demand rendering (SSR) with the Node or Cloudflare adapters. Static sites and deployments to Netlify or Vercel are not affected. Astro released a fix in version 5.12.8.

Critical Impact

Attackers can leverage this open redirect to conduct phishing and social engineering campaigns by abusing the trust of a legitimate Astro-powered domain.

Affected Products

  • Astro framework versions 5.2.0 through 5.12.7
  • Astro SSR sites using the Node adapter
  • Astro SSR sites using the Cloudflare adapter

Discovery Timeline

  • 2025-08-08 - CVE-2025-54793 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-54793

Vulnerability Analysis

The vulnerability is a classic open redirect [CWE-601] in Astro's internal path-handling helpers. When a request path begins with //, browsers and HTTP clients interpret the value in a Location response header as a protocol-relative URL. Astro's trailing slash redirection logic did not recognize //-prefixed paths as internal, so it emitted redirects that browsers resolved as external destinations. An attacker who tricks a user into clicking a link like https://trusted-astro-site.example//attacker.example/login causes the server to respond with a redirect to //attacker.example/, sending the victim to the attacker's domain while the initial URL displayed a trusted hostname. This trust transfer is the primary risk driver, enabling credential phishing and malware delivery under the guise of a legitimate site.

Root Cause

Astro's isInternalPath helper in packages/internal-helpers/src/path.ts used an INTERNAL_PREFIXES set that recognized /_, /@, and /. as internal prefixes but omitted //. Paths beginning with two slashes bypassed the internal path check and were normalized through the trailing slash redirection branch, producing a Location header that browsers interpreted as an external URL.

Attack Vector

Exploitation requires no authentication and no user interaction beyond clicking a crafted link. The attacker constructs a URL where the path segment on the vulnerable Astro origin begins with // followed by the attacker-controlled host. The SSR server returns a 3xx response whose Location header starts with //attacker.tld, and the client navigates to the attacker's domain.

typescript
// Patch applied in packages/internal-helpers/src/path.ts
 	return typeof path === 'string' || path instanceof String;
 }
 
-const INTERNAL_PREFIXES = new Set(['/_', '/@', '/.']);
+const INTERNAL_PREFIXES = new Set(['/_', '/@', '/.', '//']);
 const JUST_SLASHES = /^\/{2,}$/;
 
 export function isInternalPath(path: string) {
// Source: https://github.com/withastro/astro/commit/0567fb7b50c0c452be387dd7c7264b96bedab48f

The fix adds // to the INTERNAL_PREFIXES set so that double-slash paths are treated as internal and no longer produce external redirects.

Detection Methods for CVE-2025-54793

Indicators of Compromise

  • HTTP access logs containing request paths that begin with // followed by an external hostname, such as GET //evil.example/path.
  • Outbound 3xx responses from the Astro origin with a Location header whose value starts with //.
  • Referrer logs on downstream services showing traffic originating from the Astro site but landing on unrelated third-party domains.

Detection Strategies

  • Deploy a Web Application Firewall (WAF) rule that flags requests where the URI path matches ^/{2,}[^/] on Astro origins running vulnerable versions.
  • Inspect reverse proxy or CDN logs for response Location headers matching the regex ^//[^/].
  • Scan source repositories and package manifests for astro versions in the range 5.2.0 to 5.12.7 alongside the @astrojs/node or @astrojs/cloudflare adapters.

Monitoring Recommendations

  • Enable HTTP response header logging on edge proxies to capture Location values for post-hoc auditing.
  • Track spikes in redirect responses (301, 302, 307, 308) from Astro origins that resolve to external hosts.
  • Correlate user-reported phishing incidents with historical request paths served by the Astro application.

How to Mitigate CVE-2025-54793

Immediate Actions Required

  • Upgrade Astro to version 5.12.8 or later on all SSR deployments using the Node or Cloudflare adapters.
  • Audit hosting configurations to confirm which projects use SSR versus static output, since only SSR deployments are affected.
  • Review recent access logs for exploitation attempts and notify affected users if outbound redirects to attacker-controlled domains occurred.

Patch Information

The vulnerability is resolved in Astro 5.12.8. The upstream fix, published in commit 0567fb7b50c0c452be387dd7c7264b96bedab48f, adds // to the INTERNAL_PREFIXES set inside packages/internal-helpers/src/path.ts. Additional details are available in the GitHub Security Advisory GHSA-cq8c-xv66-36gw.

Workarounds

  • At the network edge, block outgoing redirect responses whose Location header value starts with //.
  • Add a reverse proxy rule that rewrites or rejects incoming request paths matching ^/{2,} before they reach the Astro SSR runtime.
  • Where feasible, switch temporarily to static output or a hosting target (Netlify, Vercel) that is not affected until the upgrade is deployed.
bash
# NGINX example: reject requests with double-slash paths before proxying to Astro SSR
location / {
    if ($request_uri ~ "^//") {
        return 400;
    }
    proxy_pass http://astro_ssr_upstream;
}

# Alternative: strip Location headers that begin with // from upstream responses
proxy_hide_header Location;
add_header Location $sent_http_location;
if ($sent_http_location ~ "^//") {
    return 502;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.