Unauthorized third-party images in Astro’s _image endpoint
withastro astro
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| astro npm |
|
|
| @astrojs/node npm |
|
|
withastro astro
| Product | Affected | Fixed in |
|---|---|---|
| astro npm |
|
|
| @astrojs/node npm |
|
|
Astro is a web framework for content-driven websites. In versions of astro before 5.13.2 and 4.16.18, the image optimization endpoint in projects deployed with on-demand rendering allows images from unauthorized third-party domains to be served. On-demand rendered sites built with Astro include an /_image endpoint which returns optimized versions of images. A bug in impacted versions of astro allows an attacker to bypass the third-party domain restrictions by using a protocol-relative URL as the image source, e.g. /_image?href=//example.com/image.png. This vulnerability is fixed in 5.13.2 and 4.16.18.
From the CVE record · GitHub_M
In Astro sites deployed with on-demand rendering, an attacker can use a protocol-relative image URL to bypass third-party domain restrictions on the /_image endpoint. This allows the endpoint to serve images from unauthorized domains. The input does not specify whether authentication or user interaction is required.
Check on-demand rendered sites using affected npm astro versions (>=5.0.0-alpha.0 <5.13.2 or <4.16.19) or @astrojs/node versions below 9.1.1.