CVE-2026-50146
Analyzed Analyzed - Analysis Complete
Reflected XSS in Astro Framework via Client Directives

Publication date: 2026-06-22

Last updated on: 2026-06-22

Assigner: GitHub, Inc.

Description
Astro is a web framework. Prior to 6.3.3, 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 vulnerability is fixed in 6.3.3.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-22
Last Modified
2026-06-22
Generated
2026-06-23
AI Q&A
2026-06-22
EPSS Evaluated
N/A
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
astro astro to 6.3.3 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-80 The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Mitigation Strategies

The immediate step to mitigate this vulnerability is to upgrade the Astro framework to version 6.3.3 or later, where the issue has been fixed by properly escaping the slot name before inserting it into the data-astro-template attribute.

If upgrading immediately is not possible, consider implementing input validation or sanitization on slot names to prevent injection of malicious HTML or JavaScript.

Also, review and restrict user input that can influence slot names or client:* directives to reduce the attack surface.

Executive Summary

CVE-2026-50146 is a reflected Cross-Site Scripting (XSS) vulnerability in the Astro web framework versions 6.3.1 and below.

The issue arises when a component uses a client:* directive, causing Astro to insert named slot content into a data-astro-template attribute without properly escaping the slot name.

This improper handling allows an attacker to break out of the attribute context and inject arbitrary HTML, resulting in reflected XSS during server-side rendering (SSR).

An attacker can exploit this by crafting a malicious URL with a specially crafted slot name parameter that executes arbitrary JavaScript when rendered.

The vulnerability is fixed in Astro version 6.3.3 by properly escaping the slot name before insertion.

Impact Analysis

This vulnerability can allow an attacker to execute arbitrary JavaScript in the context of the affected website during server-side rendering.

Such reflected XSS attacks can lead to unauthorized actions on behalf of users, theft of sensitive information like cookies or session tokens, and compromise of user accounts.

The CVSS score indicates a high severity with a network attack vector, low attack complexity, and no privileges required, meaning it can be exploited remotely with user interaction.

Detection Guidance

This vulnerability can be detected by testing for reflected Cross-Site Scripting (XSS) in the Astro framework versions 6.3.1 and below, specifically when components use client:* directives that insert named slot content into the data-astro-template attribute without proper HTML escaping.

One way to detect this is by crafting a malicious URL with a specially crafted slot name parameter that attempts to break out of the attribute context and inject arbitrary HTML or JavaScript, such as: abc"></template></astro-island><img src=x onerror=confirm(document.domain)>.

You can use tools like curl or wget to send requests with such payloads and observe if the response reflects the injected script without proper escaping.

  • curl -v 'http://your-astro-app/path?slotName=abc"></template></astro-island><img src=x onerror=confirm(document.domain)>'
  • Observe the HTTP response for unescaped injection of the payload in the data-astro-template attribute.

Additionally, automated web vulnerability scanners that test for reflected XSS can be used against the application to detect this issue.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-50146. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart