CVE-2026-41067 Astro: XSS via incomplete `</script>` sanitization in `define:vars` allows case-insensitive and whitespace-based bypass
MediumCVSS 6.1
EPSS 0.20%
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: partial
Description
Astro is a web framework. Prior to 6.1.6, the defineScriptVars function in Astro's server-side rendering pipeline uses a case-sensitive regex /</script>/g to sanitize values injected into inline <script> tags via the define:vars directive. HTML parsers close <script> elements case-insensitively and also accept whitespace or / before the closing >, allowing an attacker to bypass the sanitization with payloads like </Script>, </script >, or </script/> and inject arbitrary HTML/JavaScript. This vulnerability is fixed in 6.1.6.
Upgrade path
3 packages: 2 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| astro | < 6.1.6 | 6.1.6 | Fixed |
| npm astro(npm) | < 6.1.6 | 6.1.6 | Fixed |
| withastro astro | = < 6.1.6 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| withastro astro | = < 6.1.6 | No fix listed |
| npm astro(npm) | < 6.1.6 | 6.1.6 |
| astro | < 6.1.6 | 6.1.6 |
References
- https://github.com/withastro/astro/security/advisories/GHSA-j687-52p2-xcff exploit mitigation vendor-advisory
- github.com
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com
- github.com product