Mittel

Astro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering

  • Veröffentlicht: 22.10.2026
  • Aktualisiert: 22.10.2026 20:17

Summary

Astro's JSX and MDX rendering pipeline treated string children of <script> and <style> elements as trusted HTML. When a dynamic value was passed through a JSX expression, such as <script>{value}</script>, an attacker-controlled value containing </script> or </style> could terminate the element and inject arbitrary HTML and JavaScript.

Other JSX expression contexts escaped dynamic strings automatically. This behavior was limited to <script> and <style> children rendered through Astro's astro:jsx renderer, including MDX components.

Details

The affected rendering paths marked all string children of <script> and <style> elements as safe HTML, without distinguishing literal content generated by the compiler from dynamic expression values. An application was vulnerable when attacker-controlled data, such as a query parameter or CMS field, was interpolated directly into one of these elements.

For example, a value containing </script><script>alert(1)</script> passed to <script>{value}</script> was emitted without escaping. The browser interpreted the first closing tag as markup and executed the injected script.

The fix preserves raw rendering for literal script and style content while escaping dynamic string children like other JSX expression values.

Impact

Affected applications could be vulnerable to reflected or stored cross-site scripting. Exploitation required an application to pass attacker-controlled data directly as a dynamic child of a <script> or <style> element in MDX or through the astro:jsx runtime. Successful exploitation allowed arbitrary JavaScript execution in the victim's browser under the application's origin.

Patches

This issue is patched in astro@7.3.2.

Workarounds

Do not interpolate untrusted dynamic values directly into <script> or <style> element children. Applications that cannot upgrade should validate and contextually encode these values before rendering them.

Credit

Reported by @RKasai127.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket astro < 7.3.2 7.3.2

Verweise

CVSS-Wert 6.5/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Schwäche (CWE)
CWE-79
Plattform
npm
Paket
astro
Veröffentlicht
22.10.2026
Aktualisiert
22.10.2026 20:17

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-98hj-9722-w3j8 - CC BY 4.0

Schwachstellenhistorie: astro

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (29) im Archiv
Einträge insgesamt
29
Erste → letzte
10.2024 10.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 1
  • Hoch 6
  • Mittel 16
  • Niedrig 6

Veröffentlichungen pro Jahr

  1. 2024: 3
  2. 2025: 11
  3. 2026: 15
Schweregrad:
  1. Astro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering dieser Eintrag
    Mittel · 6.5 CVE-2026-114128 < 7.3.2 7.3.2
  2. Kritisch · 9.8 ghsa-26w7-cxv4-gfx2 < 7.2.8 7.2.8
  3. Hoch · 7.5 CVE-2026-54299 < 6.4.6 6.4.6
  4. Hoch · 7.1 CVE-2026-50146 < 6.3.3 6.3.3
  5. Hoch · 7.1 CVE-2025-64764 < 5.15.8 5.15.8
  6. Hoch · 7.2 CVE-2025-59837 >= 5.13.4, < 5.13.10 5.13.10
  7. Hoch CVE-2024-56159 >= 5.0.0-alpha.0, < 5.0.8, < 4.16.18 5.0.8, 4.16.18

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.