CVE-2026-59727
JavaScript Analyse et atténuation des vulnérabilités

Aperçu

CVE-2026-59727 is a reflected cross-site scripting (XSS) vulnerability in the Astro web framework (npm package astro) caused by unescaped transition:* directive values on client-hydrated island components. When a developer reflects attacker-controlled input into a transition:persist, transition:scope, or transition:persist-props directive, Astro copies the raw value onto the rendered <astro-island> element without HTML-escaping, allowing injection of arbitrary HTML/JavaScript into the server-rendered response. The vulnerability affects astro versions >= 3.10.0 and < 7.0.4 (introduced in v3.10.0 via PR #7861). It was reported by @jlgore, published as a security advisory on July 17, 2026, and added to the GitHub Advisory Database on July 20, 2026. The CVSS v4.0 base score is 2.1 (Low) (GitHub Advisory, Astro Security Advisory).

Détails techniques

The root cause is improper output encoding (CWE-116, CWE-79, CWE-83) in generateHydrateScript() within packages/astro/src/runtime/server/hydration.ts. While attrs, props, and opts island properties are all passed through escapeHTML() before serialization, the transition directives (data-astro-transition-scope, data-astro-transition-persist, data-astro-transition-persist-props) were copied verbatim via island.props[name] = props[name] without escaping. The island element is then serialized with renderElement('astro-island', island, false) where shouldEscape=false, meaning toAttributeString() returns the value unchanged, and the raw attacker-controlled string reaches the HTML response. Exploitation requires the application developer to have written a non-idiomatic pattern — directly reflecting untrusted, request-derived input (e.g., a URL query parameter) into one of these transition directives. This is the same output sink class previously addressed for slot names in GHSA-8hv8-536x-4wqp (GitHub Advisory, Fix Commit).

Impact

Successful exploitation results in reflected XSS, allowing an attacker who induces a victim to visit a crafted URL to execute arbitrary JavaScript in the victim's browser session on the affected origin. This can lead to session token theft, credential harvesting, defacement of page content, or redirection to malicious sites. The impact is limited to the subsequent system (browser context) — the vulnerable server system itself has no direct confidentiality or integrity impact — and availability is unaffected. Exploitation is constrained to applications where developers have passed untrusted input directly into a transition directive, limiting the real-world attack surface (Astro Security Advisory).

Étapes d’exploitation

  1. Identify a vulnerable target: Find an Astro application running astro >= 3.10.0 and < 7.0.4 that uses a client:* hydrated component with a transition:persist, transition:scope, or transition:persist-props directive whose value is derived from attacker-controlled input (e.g., a URL query parameter).
  2. Craft a malicious URL: Construct a URL that injects an XSS payload into the relevant query parameter. For example, if the application reflects Astro.url.searchParams.get('persist') into transition:persist, craft: https://example.com/?persist="><img src=x onerror=alert(1)>
  3. Deliver the URL to a victim: Use phishing, social engineering, or another delivery mechanism to induce the victim to visit the crafted URL.
  4. Payload executes: The server renders the <astro-island> element with the unescaped attribute value, breaking out of the attribute context. The injected <img src=x onerror=alert(1)> (or equivalent payload) executes in the victim's browser on the target origin, enabling session theft, credential harvesting, or further attacks (Astro Security Advisory, GitHub Advisory).

Indicateurs de compromis

  • Network: HTTP requests to Astro application pages containing URL-encoded HTML injection sequences (e.g., %22%3E%3Cscript, "><img, "><svg) in query parameters that correspond to transition:persist, transition:scope, or transition:persist-props directive values.
  • Logs: Web server or application access logs showing requests with suspicious query parameter values containing quote characters, angle brackets, or JavaScript event handler strings (e.g., onerror=, onload=, alert() in parameters reflected into transition directives.
  • Response Content: Server-rendered HTML responses containing unescaped <script>, <img>, or <svg> tags within <astro-island> element attributes (data-astro-transition-persist, data-astro-transition-scope, data-astro-transition-persist-props) — indicative of a vulnerable and actively exploited instance.

Atténuation et solutions de contournement

Upgrade to astro@7.0.4 or later, which fixes the issue by applying escapeHTML(String(props[name])) to transition directive values before rendering them onto the island element (PR #17212, commit 7ba0bb1) (Astro Release, Fix Commit). As a workaround for teams unable to upgrade immediately, do not pass untrusted or request-derived input into transition:persist, transition:scope, or transition:persist-props directives. If dynamic values are required, HTML-escape or strictly allowlist-validate the input before passing it to the directive (Astro Security Advisory).

Réactions de la communauté

The vulnerability was published by Astro maintainer @matthewp as a low-severity security advisory on July 17, 2026, with the fix merged on June 29, 2026 ahead of public disclosure. The advisory notes this is the same output sink class previously addressed for slot names (GHSA-8hv8-536x-4wqp), suggesting a pattern of incremental hardening in Astro's island rendering pipeline. No significant broader media coverage or notable community controversy has been observed (Astro Security Advisory).

Ressources additionnelles


SourceCe rapport a été généré à l’aide de l’IA

Apparenté JavaScript Vulnérabilités:

Identifiant CVE

Sévérité

Score

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

CVE-2026-53668MEDIUM6.9
  • JavaScript logoJavaScript
  • react-router
NonOuiJul 27, 2026
CVE-2026-59729MEDIUM5.1
  • JavaScript logoJavaScript
  • astro
NonOuiJul 27, 2026
CVE-2026-59728MEDIUM4.3
  • JavaScript logoJavaScript
  • @astrojs/rss
NonOuiJul 27, 2026
CVE-2026-59730LOW2.1
  • JavaScript logoJavaScript
  • @astrojs/node
NonOuiJul 27, 2026
CVE-2026-59727LOW2.1
  • JavaScript logoJavaScript
  • astro
NonOuiJul 27, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité dans le cloud

Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité pour évaluer votre niveau de risque et identifier les failles dans vos défenses.

Demander une évaluation

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités