Description
Astro is a web framework for content-driven websites. In versions 3.10.0 through 7.0.3, when a transition:persist, transition:scope, or transition:persist-props directive is applied to a client-hydrated (client:*) component, Astro copied the directive value onto the rendered <astro-island> element without HTML-escaping it. If a developer reflects attacker-controlled input into one of these directives, an attacker can break out of the attribute and inject arbitrary HTML/JavaScript into the server-rendered output, resulting in reflected cross-site scripting (XSS). Exploitation requires the application developer to have written a non-idiomatic pattern — passing untrusted, request-derived input directly into a transition directive. Astro applications that do not route untrusted input into these directives are unaffected. This issue has been fixed in version 7.0.4.
Published: 2026-07-27
Score: 2.1 Low
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Astro is a web framework that renders client‑hydrated components. In versions 3.10.0 through 7.0.3, the framework copies the value of transition:persist, transition:scope, or transition:persist‑props directives directly onto the rendered <astro‑island> element without applying HTML escaping. When a developer introduces attacker‑controlled, request‑derived input into one of these attributes, the value can break out of the attribute context and inject arbitrary HTML or JavaScript into the server‑rendered page, creating a reflected cross‑site scripting vulnerability. The flaw arises from improper output encoding (CWE‑116) and failure to validate output (CWE‑79, CWE‑83).

Affected Systems

Versions 3.10.0 through 7.0.3 of the withastro Astro framework are affected. Applications that use client‑hydrated (client:*) components with the aforementioned transition directives and feed them request‑derived or untrusted input are vulnerable. Astro applications that do not route untrusted data into these directives are not impacted.

Risk and Exploitability

The CVSS score of 2.1 indicates a low baseline severity, and the EPSS score of < 1 % suggests the current probability of exploitation is low. The vulnerability is not listed in the CISA KEV catalog. Based on the description, the likely attack vector is developer‑ or code‑integrity risk rather than a direct network‑based payload. Since the flaw is reflected XSS, an attacker can execute malicious JavaScript in the context of any visitor who loads the compromised page.

Generated by OpenCVE AI on August 3, 2026 at 16:49 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update Astro to version 7.0.4 or later, which removes the unescaped directive behaviour.
  • Refactor any usage of transition:persist, transition:scope or transition:persist‑props by ensuring that no request‑derived or untrusted data is assigned to these directives; sanitize or encode the values before assignment.
  • Review the application code to confirm that all transition directives receive only trusted, hard‑coded values, implementing input validation where necessary.

Generated by OpenCVE AI on August 3, 2026 at 16:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-7pw4-f3q4-r2p2 Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands
History

Tue, 28 Jul 2026 16:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 28 Jul 2026 02:45:00 +0000

Type Values Removed Values Added
First Time appeared Withastro
Withastro astro
Vendors & Products Withastro
Withastro astro

Mon, 27 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Description Astro is a web framework for content-driven websites. In versions 3.10.0 through 7.0.3, when a transition:persist, transition:scope, or transition:persist-props directive is applied to a client-hydrated (client:*) component, Astro copied the directive value onto the rendered <astro-island> element without HTML-escaping it. If a developer reflects attacker-controlled input into one of these directives, an attacker can break out of the attribute and inject arbitrary HTML/JavaScript into the server-rendered output, resulting in reflected cross-site scripting (XSS). Exploitation requires the application developer to have written a non-idiomatic pattern — passing untrusted, request-derived input directly into a transition directive. Astro applications that do not route untrusted input into these directives are unaffected. This issue has been fixed in version 7.0.4.
Title Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands
Weaknesses CWE-116
CWE-79
CWE-83
References
Metrics cvssV4_0

{'score': 2.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-28T15:20:18.915Z

Reserved: 2026-07-06T15:34:16.917Z

Link: CVE-2026-59727

cve-icon Vulnrichment

Updated: 2026-07-28T15:08:29.565Z

cve-icon NVD

Status : Deferred

Published: 2026-07-27T20:16:40.153

Modified: 2026-07-28T16:19:23.083

Link: CVE-2026-59727

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T17:00:06Z

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

  • CWE-83

    Improper Neutralization of Script in Attributes in a Web Page