Miggo Logo

CVE-2025-58179: Server-Side Request Forgery via /_image endpoint in Astro Cloudflare adapter

7.2

CVSS Score
3.1

Basic Information

EPSS Score
-
Published
9/4/2025
Updated
9/4/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
@astrojs/cloudflarenpm>= 11.0.3, < 12.6.612.6.6

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The security advisory points to a Server-Side Request Forgery (SSRF) vulnerability in the @astrojs/cloudflare adapter's /_image endpoint. The provided commit 9ecf3598e2b29dd74614328fde3047ea90e67252 contains the fix for this vulnerability. Analysis of the commit shows modifications to packages/integrations/cloudflare/src/entrypoints/image-endpoint.ts. Specifically, the GET function, which handles the endpoint's logic, was changed. Before the patch, the function would fetch any URL passed in the href query parameter. The patch introduces checks using isRemotePath and isRemoteAllowed to validate the URL against the user's image domain configuration (image.domains or image.remotePatterns). If the URL points to a non-whitelisted remote domain, the request is rejected. This confirms that the GET function was the source of the vulnerability, as it processed potentially malicious input without proper validation.

Vulnerable functions

GET
packages/integrations/cloudflare/src/entrypoints/image-endpoint.ts
The `GET` function in `packages/integrations/cloudflare/src/entrypoints/image-endpoint.ts` is an API route handler for the `/_image` endpoint. In the vulnerable versions, this function retrieves the `href` parameter from the URL and uses it directly in a `fetch` call. There was no validation to check if the URL provided in `href` belongs to a domain authorized by the application's configuration. This allows an attacker to craft a URL that causes the server to make a request to any arbitrary domain, leading to a Server-Side Request Forgery (SSRF) vulnerability.

WAF Protection Rules

WAF Rule

### Summ*ry W**n usin* *stro's *lou**l*r* ***pt*r (`@*strojs/*lou**l*r*`) *on*i*ur** wit* `output: 's*rv*r'` w*il* usin* t** ****ult `im***S*rvi**: '*ompil*'`, t** **n*r*t** im*** optimiz*tion *n*point *o*sn't ****k t** URLs it r***iv*s, *llowin* *o

Reasoning

T** s**urity **visory points to * S*rv*r-Si** R*qu*st *or**ry (SSR*) vuln*r**ility in t** `@*strojs/*lou**l*r*` ***pt*r's `/_im***` *n*point. T** provi*** *ommit `****************************************` *ont*ins t** *ix *or t*is vuln*r**ility. *n*l