Servers and applications
GHSA-c335-jqf9-8wmc
Reflected XSS via data URIs with an allow-listed host in the image endpoint
- Severity
- Medium 6.1
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 7.4.14
- Weakness
- Cross-site scripting (CWE-79)
- Attack
- Over the network · No login needed · Needs someone to click or open something
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Sources
- Project advisories (GitHub)
Description
Astro's /_image endpoint only loads remote images whose URL is allowed by image.domains or image.remotePatterns. Data URIs are meant to be allowed only by an explicit remotePatterns: [{ protocol: 'data' }] entry. That check could be bypassed by writing the data URI with a host: data is not a special URL scheme, so the URL parser reads cdn.example.com as the hostname of data://cdn.example.com/,. Any image.domains entry for that host, and any remotePatterns entry without a protocol that matched it, therefore allowed the data URI.
For example, with this configuration:
a link to /_image?href=data://cdn.example.com/, returned the attacker's SVG unchanged as image/svg+xml from the site's own origin, and the script ran when the link was opened.
Reflected cross-site scripting on on-demand rendered sites that use Astro's /_image endpoint and allow a remote host through image.domains, or through an image.remotePatterns entry without a protocol.
Workarounds
Upgrade to astro 7.4.14 or later. Before upgrading, replace image.domains entries and image.remotePatterns entries that have no protocol with remotePatterns entries that set protocol: 'https':
Affected software
| Software | Affected versions |
|---|---|
AstroServers and applications · github:withastro/astro |
|
About Astro
The web framework for content-driven websites.
- Developers who used it in the past year
- 4.5%Stack Overflow Developer Survey 2025, 2025
- Weekly downloads (npm)
- 12,020,872npm, 29 Nov 2026
- GitHub stars
- 64,305GitHub, 29 Nov 2026
- Forks
- 3,943GitHub, 29 Nov 2026
- Latest release
- @astrojs/[email protected]GitHub, 29 Nov 2026
- Released
- 18 Nov 2026GitHub
- First published on GitHub
- 15 Mar 2021GitHub
Vulnerabilities in Astro
- In our list
- 35
- Published in the last 12 months
- 22
- Critical, last 12 months
- 1
- High, last 12 months
- 2
- Known exploited
- 0
- GHSA-3285-4h5r-3q5xAuthorization bypass in middleware via double-encoded action namesMedium 4.8 2 Dec 2026
- GHSA-r7x2-725f-h4m9XSS via unescaped object values in JSX and MDX elementsMedium 6.1 2 Dec 2026
- CVE-2026-126365Astro: XSS via unescaped code for unsupported languages in @astrojs/prismMedium 5.4 12 Nov 2026
- CVE-2026-126363Astro: Reflected XSS via unescaped slot names in @astrojs/solid-jsLow 2.3 12 Nov 2026
- CVE-2026-126362Astro: Reflected XSS via unescaped slot names in @astrojs/svelteLow 2.3 12 Nov 2026
- CVE-2026-126364Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystemsMedium 6.3 9 Nov 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-c335-jqf9-8wmc
- github.com https://github.com/withastro/astro/security/advisories/GHSA-c335-jqf9-8wmc