Severity by source
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Reflected XSS reachable over the network without auth but needs victim click (UI:R); injected script in app origin yields scope change with limited C/I impact and no availability effect.
Primary rating from NVD.
CVSS VectorNVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Lifecycle Timeline
4Blast Radius
ecosystem impact- 1 npm packages depend on astro (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 6.3.3.
DescriptionNVD
Summary
When a component uses a client:* directive, Astro inserts named slot content into a data-astro-template attribute without HTML escaping the slot name allowing an attacker to break out of the attribute context and inject arbitrary HTML, resulting in reflected XSS during SSR.
This is similar to GHSA-wrwg-2hg8-v723 but exploits a different injection point.
Vulnerable Code
packages/astro/src/runtime/server/render/component.ts:371:376
// component.ts:371
`<template data-astro-template${key !== 'default' ? `="${key}"` : ''}>${children[key]}</template>`I found that key is interpolated directly into the attribute value without proper escaping.
Proof of Concept
For the PoC, I set up with a minimal repository with Astro 6.3.1, Node.js: v26.0.0.
astro.config.mjs
import react from '@astrojs/react';
import node from '@astrojs/node';
import { defineConfig } from 'astro/config';
export default defineConfig({
output: 'server',
adapter: node({ mode: 'standalone' }),
integrations: [react()],
});src/pages/index.astro
---
import Wrapper from '../components/Wrapper.jsx';
const slotName = Astro.url.searchParams.get('tab') ?? 'default';
---
<html><body>
<Wrapper client:load>
<div slot={slotName}>content</div>
</Wrapper>
</body></html>src/components/Wrapper.jsx
export default function Wrapper() { return null; }Payload:
abc"></template></astro-island><img src=x onerror=confirm(document.domain)><!--Accessing this URL will trigger the popup.
http://localhost:4321/?tab=abc%22%3E%3C%2Ftemplate%3E%3C%2Fastro-island%3E%3Cimg+src%3Dx+onerror%3Dconfirm(document.domain)%3E%3C!--
<img width="1268" height="592" alt="image" src="https://github.com/user-attachments/assets/675cdc04-4134-4d83-883c-abe16d751ec7" />
This will render in html.
<template data-astro-template="abc"></template></astro-island>
<img src=x onerror=confirm(document.domain)><!--">content</template>Fix
I suggest leveraging the existing escape function on the slot name.
// component.ts:371
`<template data-astro-template${key !== 'default' ? `="${escapeHTML(String(key))}"` : ''}>${children[key]}</template>`---
Articles & Coverage 1
AnalysisAI
Reflected cross-site scripting in Astro framework (versions prior to 6.3.3) allows remote attackers to inject arbitrary HTML and execute JavaScript in victim browsers when an SSR-rendered page passes user-controlled input as a slot name to a component using a client:* directive. The flaw lives in the server renderer, which interpolates the slot name into a data-astro-template attribute without HTML escaping, enabling attribute-context breakout. No public exploit identified at time of analysis beyond the reporter's PoC in the GHSA advisory, and the issue is not listed in CISA KEV.
Technical ContextAI
Astro is a server-side rendering web framework (pkg:npm/astro) that hydrates interactive islands using client:* directives such as client:load. During SSR, packages/astro/src/runtime/server/render/component.ts builds a <template data-astro-template="KEY"> wrapper for each named slot, but the KEY value is template-literal-interpolated directly into the attribute without passing through the existing escapeHTML helper. This is a textbook CWE-79 (Improper Neutralization of Input During Web Page Generation) instance where an output-encoding control is missing at a specific attribute sink, allowing an attacker who can influence the slot name (typically via a query parameter that feeds slot={...}) to close the attribute, the <template>, and the surrounding <astro-island>, then inject arbitrary tags such as <img src=x onerror=...>.
RemediationAI
Upgrade the astro npm package to version 6.3.3 or later, which adds HTML escaping of the slot name in packages/astro/src/runtime/server/render/component.ts as described in the GHSA-8hv8-536x-4wqp advisory (https://github.com/withastro/astro/security/advisories/GHSA-8hv8-536x-4wqp). If immediate upgrade is not possible, audit .astro pages for patterns where slot={...} is bound to values derived from Astro.url.searchParams, request bodies, headers, or other untrusted sources, and either hard-code the slot name, validate it against an allowlist of known slot identifiers, or wrap it with a manual HTML escape before passing it to the component - note that simply removing the client:* directive disables interactive hydration for that island and may regress UI behavior. A Content-Security-Policy without unsafe-inline can reduce impact of injected scripts but will not stop HTML-only payloads such as <img onerror>.
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic
Directory traversal vulnerability in lib/app/index.js in Geddy before 13.0.8 for Node.js allows remote attackers to read
Credential-harvesting malware compromised 84 versions of 42 TanStack npm packages on 2026-05-11 via chained GitHub Actio
Eval injection vulnerability in index.js in the syntax-error package before 1.1.1 for Node.js 0.10.x, as used in IBM Rat
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-38335
GHSA-8hv8-536x-4wqp