The vulnerability is a Server-Side Request Forgery (SSRF) in the Astro image processing pipeline. The root cause is twofold. First, the getImage function, when used with the inferSize: true option for remote images, would call the inferRemoteSize function without validating the image URL against the configured image.domains or image.remotePatterns allowlists. The inferRemoteSize function would then proceed to fetch the URL directly, allowing an attacker who can control the image source to make the server issue requests to any URL, including internal network services.
Second, several loadRemoteImage functions across the codebase were vulnerable to SSRF via open redirects. These functions used the fetch API without explicitly disabling redirects. An attacker could supply a URL from an allowed domain that redirects to a restricted internal or external service, and the server would follow the redirect, bypassing the security controls. The patch addresses both issues by adding allowlist checks before inferring image sizes and by explicitly disabling redirects in all remote image fetching operations.