CVE-2026-126362
Astro: Reflected XSS via unescaped slot names in @astrojs/svelte
Impact
Astro is a web framework for content-driven websites. From 5.7.3 until 9.1.2, the @astrojs/svelte renderer inserted a named slot into the quoted name attribute of an astro-slot wrapper without HTML escaping. Request-controlled slot names containing a quote could terminate the attribute and inject active HTML. Exploitation required a hydrated Svelte component using a client:* directive and dynamic rendering of the attacker-chosen slot; components that did not render that slot emitted only Astro's escaped fallback content. Both server rendering and client-side hydration used the unsafe slot name. This issue is fixed in version 9.1.2.
An attacker can exploit this over the network, without logging in, but a user has to be involved, for example by viewing content. Specific conditions have to be met, which makes an attack harder. If it succeeds: low risk of data being read, low risk of data or systems being changed.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | @astrojs/svelte | >= 5.7.3, <= 9.1.1 | 9.1.2 |
Affected products · Withastro
| Product | Affected versions |
|---|---|
| Astro | from 5.7.3, before 9.1.2 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/withastro/astro/security/advisories/GHSA-f4j9-crrj-867q
- https://github.com/withastro/astro/commit/5e476365378e41aa2745d003b2383d02008d7b44
- https://github.com/withastro/astro/releases/tag/@astrojs/svelte@9.1.2
- https://github.com/advisories/GHSA-f4j9-crrj-867q