Vulnerabilities/

Astro: XSS in define:vars via incomplete </script> tag sanitization

Severity:
Medium

Description

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.

Recommendation

Update the astro package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
astro
Anything's wrong? Let us know Last updated on April 27, 2026