CVE-2026-41067
published 2026-04-24CVE-2026-41067: 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 //g to sanitize…
PriorityP429medium6.1CVSS 3.1
AVNACLPRNUIRSCCLILAN
EPSS
0.19%
8.7th percentile
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 //g to sanitize values injected into inline tags via the define:vars directive. HTML parsers close elements case-insensitively and also accept whitespace or / before the closing >, allowing an attacker to bypass the sanitization with payloads like , , or and inject arbitrary HTML/JavaScript. This vulnerability is fixed in 6.1.6.
Affected
3 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| astro | astro | < 6.1.6 | 6.1.6 |
| astro | astro | >= 0 < 6.1.6 | 6.1.6 |
| withastro | astro | < 6.1.6 | 6.1.6 |
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
VulDB
withastro up to 6.1.5 HTML Parser defineScriptVars HTML injection (GHSA-j687-52p2-xcff)
vuldb·2026-04-24·CVSS 6.1
CVE-2026-41067 [MEDIUM] withastro up to 6.1.5 HTML Parser defineScriptVars HTML injection (GHSA-j687-52p2-xcff)
A vulnerability was found in withastro astro up to 6.1.5. It has been classified as problematic. This impacts the function defineScriptVars of the component HTML Parser. Performing a manipulation results in HTML injection.
This vulnerability is identified as CVE-2026-41067. The attack can be initiated remotely. There is not any exploit available.
Upgrading the affected component is recommended.
GHSA
Astro: XSS in define:vars via incomplete </script> tag sanitization
ghsa·2026-04-21
CVE-2026-41067 [MEDIUM] CWE-79 Astro: XSS in define:vars via incomplete </script> tag sanitization
Astro: XSS in define:vars via incomplete tag sanitization
## Summary
The `defineScriptVars` function in Astro's server-side rendering pipeline uses a case-sensitive regex `//g` to sanitize values injected into inline `` tags via the `define:vars` directive. HTML parsers close `` elements case-insensitively and also accept whitespace or `/` before the closing `>`, allowing an attacker to bypass the sanitization with payloads like ``, ``, or `` and inject arbitrary HTML/JavaScript.
## Details
The vulnerable function is `defineScriptVars` at `packages/astro/src/runtime/server/render/util.ts:42-53`:
```typescript
export function defineScriptVars(vars: Record) {
let output = '';
for (const [key, value] of Object.entries(vars)) {
output += `const ${toIdent(key)} = ${JSON.stringify(value)?.r
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
2026-04-24
Published