CVE-2026-59727 Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands

Low 2.1 Published Updated

Attackers can inject arbitrary JavaScript via unescaped transition directives in Astro if developers pass untrusted input to them.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-59727?

CVE-2026-59727 is a low-severity cross-site scripting vulnerability in withastro astro, published on 27 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-83, CWE-79, CWE-116

Which versions are affected by CVE-2026-59727?

2 open source packages ship an affected version, including astro.

PackageAffectedFixed in
astro npmFrom 3.10.07.0.4
astro npmFrom 3.10.07.0.4

How do I fix CVE-2026-59727?

Upgrade astro to 7.0.4 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-59727 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-59727 exists.

Sources

Also known as GHSA-7pw4-f3q4-r2p2.

Is CVE-2026-59727 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free