Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. astro
  4. ›
  5. CVE-2026-41067

CVE-2026-41067: Astro: XSS in define:vars via incomplete </script> tag sanitization

April 21, 2026 (updated April 27, 2026)

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.

References

  • github.com/advisories/GHSA-j687-52p2-xcff
  • github.com/withastro/astro/releases/tag/astro@6.1.6
  • github.com/withastro/astro/security/advisories/GHSA-j687-52p2-xcff
  • nvd.nist.gov/vuln/detail/CVE-2026-41067

Code Behaviors & Features

Detect and mitigate CVE-2026-41067 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 6.1.6

Fixed versions

  • 6.1.6

Solution

Upgrade to version 6.1.6 or above.

Impact 6.1 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/astro/CVE-2026-41067.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:47 +0000.