CVE-2025-55303: Astro allows unauthorized third-party images in _image endpoint
N/A
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| astro | npm | >= 5.0.0-alpha.0, <= 5.13.0 | 5.13.2 |
| @astrojs/node | npm | <= 9.1.0 | 9.1.1 |
| astro | npm | <= 4.16.18 | 4.16.19 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability exists in the /_image endpoint, which is handled by the GET functions in packages/astro/src/assets/endpoint/generic.ts and packages/astro/src/assets/endpoint/node.ts. The core of the issue lies in the isRemotePath utility function, which failed to correctly identify protocol-relative URLs (e.g., //example.com/image.png) as remote. An attacker could craft a URL to the /_image endpoint using a protocol-relative href parameter pointing to an unauthorized domain. The server would then fetch and serve the image from this domain, bypassing the intended security restrictions. This could be used to serve malicious content, such as specially crafted SVGs that could lead to Cross-Site Scripting (XSS). The patches address this by updating the path validation logic in @astrojs/internal-helpers to correctly classify protocol-relative URLs as remote, ensuring that the domain authorization checks are properly applied.