CVE-2025-55207
Executive Summary
CVE-2025-55207 is an open redirect vulnerability affecting the Astro web framework, specifically in deployments using the Node adapter in standalone mode with trailingSlash set to always. This is a bypass of the previously patched CVE-2025-54793. An attacker can craft a URL like https://example.com//attacker.com/path which will redirect the user to //attacker.com/path, an external origin. This can be used in phishing attacks to trick users into visiting malicious sites while the initial domain appears legitimate. The vulnerability is patched in Astro version 9.4.1.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Astro is distributed via npm. Users should update their astro package to version 9.4.1 or later. The vulnerability is in the core framework's routing logic when used with the Node adapter. No malicious packages or compromised dependencies have been identified.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a crafted link)
- Scope: Unchanged
- Confidentiality Impact: Low (potential credential theft via phishing)
- Integrity Impact: Low (redirect to malicious site)
- Availability Impact: None
Threat Level: Medium. The vulnerability requires user interaction but can be exploited in phishing campaigns. The bypass nature indicates incomplete patching of the original issue.
Deep Dive & Mechanics
The vulnerability lies in how Astro's routing handles URLs with double slashes (//) when the Node adapter is in standalone mode and trailingSlash is set to always. The original fix for CVE-2025-54793 prevented redirects like https://example.com//astro.build/press from redirecting to //astro.build/press. However, the fix was incomplete.
When trailingSlash: "always" is configured, Astro's server-side logic appends a trailing slash to URLs. The double-slash prefix // is interpreted by browsers as a protocol-relative URL, meaning //attacker.com is treated as https://attacker.com. The Astro server, when processing the request, sees the path as //attacker.com/path and, due to the trailing slash logic, may redirect to //attacker.com/path/ (with trailing slash). This redirect is sent to the client, which then follows the protocol-relative URL to the external attacker domain.
The specific conditions are:
- Astro version < 9.4.1.
- Using the
@astrojs/nodeadapter in standalone mode. trailingSlashset toalwaysinastro.config.mjs.- A crafted URL with
//followed by an external domain.
Vulnerable vs. Patched Code
Vulnerable Code (Astro < 9.4.1): The vulnerable logic likely resides in the server-side redirect handling. A simplified representation:
// Vulnerable: does not sanitize double slashes
function handleRedirect(url) {
if (url.endsWith('/')) {
return url;
}
return url + '/';
}
When url is //attacker.com/path, the function returns //attacker.com/path/, which is a protocol-relative redirect.
Patched Code (Astro >= 9.4.1): The patched version sanitizes the URL to prevent protocol-relative redirects:
// Patched: ensures no double slash at start
function handleRedirect(url) {
// Remove leading double slashes
url = url.replace(/^\/\//, '/');
if (url.endsWith('/')) {
return url;
}
return url + '/';
}
This ensures that //attacker.com/path becomes /attacker.com/path (a relative path on the same domain), preventing the open redirect.
Exploitation & Lab Setup
Red Team (Attacker) Perspective
Prerequisites:
- Target Astro site using Node adapter in standalone mode with
trailingSlash: "always". - Victim must click a crafted link.
Exploitation Steps:
- Identify a vulnerable Astro site (e.g.,
https://example.com). - Craft a malicious URL:
https://example.com//evil.com/phishing-page. - Send this link to the victim via email, social media, etc.
- When the victim clicks, they are redirected to
https://evil.com/phishing-page(due to protocol-relative URL). - The attacker can host a phishing page mimicking the original site to steal credentials.
Proof of Concept (PoC):
# Simple curl test to see the redirect
curl -v "https://example.com//evil.com/test"
# Expected response: 302 Location: //evil.com/test/
Blue Team (Defender) Perspective
Detection:
- Monitor server logs for requests with double slashes in the path (e.g.,
//). - Look for unusual redirect patterns, especially to external domains.
- Use the detection rules provided below.
Mitigation:
- Immediately update Astro to version 9.4.1 or later.
- If immediate update is not possible, consider disabling
trailingSlash: "always"or switching to a different adapter. - Implement a Web Application Firewall (WAF) rule to block requests with
//in the path.
Indicators of Compromise (IOCs)
- URL Pattern:
https://<target>//<external-domain>/<path> - Server Log Entries: Requests with path starting with
//followed by an external domain. - Redirect Response: HTTP 302 with
Locationheader containing//<external-domain>. - Network Traffic: Outbound connections to unexpected domains following a redirect from the Astro site.
Detection Engineering
YARA Rule
rule CVE_2025_55207_Astro_Open_Redirect {
meta:
description = "Detects Astro open redirect attempts via double slash"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-55207"
strings:
$redirect = /Location: \/\/[a-zA-Z0-9.-]+\// nocase
$double_slash = /\/\/[a-zA-Z0-9.-]+\// nocase
condition:
$redirect or $double_slash
}
Sigma Rule
title: Astro Open Redirect via Double Slash (CVE-2025-55207)
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects HTTP requests with double slashes indicating an open redirect attempt
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-stem|contains: "//"
sc-status: 302
condition: selection
falsepositives:
- Legitimate use of double slashes in some applications
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-55207 Astro Open Redirect Attempt"; flow:to_server; content:"//"; http_uri; pcre:"/\/\/[a-zA-Z0-9.-]+\//"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update Astro: Upgrade to version 9.4.1 or later.
npm install astro@9.4.1 - Verify Configuration: Ensure
trailingSlashis not set toalwaysif immediate update is not possible. - WAF Rule: Add a rule to block requests with
//in the path.if ($request_uri ~ "^//") { return 403; }
Long-Term Measures:
- Implement regular security audits of Astro configurations.
- Monitor for similar bypasses in future patches.
- Educate users about phishing links with unusual URL patterns.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI. For further analysis, contact security@valters-it.com.