CVE-2025-58179: Server-Side Request Forgery via /_image endpoint in Astro Cloudflare adapter
7.2
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| @astrojs/cloudflare | npm | >= 11.0.3, < 12.6.6 | 12.6.6 |
Vulnerability Intelligence
Miggo AI
Root 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
GETpackages/integrations/cloudflare/src/entrypoints/image-endpoint.ts