Astro: Remote allowlist bypass via unanchored matchPathname wildcard
withastro astro
withastro astro
| Product | Affected | Fixed in |
|---|---|---|
| astro npm |
|
|
Astro is a web framework. From version 2.10.10 to before version 5.18.1, this issue concerns Astro's remotePatterns path enforcement for remote URLs used by server-side fetchers such as the image optimization endpoint. The path matching logic for /* wildcards is unanchored, so a pathname that contains the allowed prefix later in the path can still match. As a result, an attacker can fetch paths outside the intended allowlisted prefix on an otherwise allowed host. This issue has been patched in version 5.18.1.
From the CVE record · GitHub_M
Astro's remotePatterns path matching does not anchor /* wildcards. An attacker can use a server-side fetcher, such as the image optimization endpoint, to fetch a path outside the intended allowlisted prefix on an otherwise allowed host if the path contains that prefix later on.
Teams running the npm astro package from version 2.10.10 up to, but not including, 5.18.1 should check their installations.