Every CVE Search/ Get API key

CVE-2026-59727

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

2.1 LowFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
Active

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
None

Exploit likelihood

0.39%Up 0.1 points since Jul 28, 2026
90%50%10%1%

What each source reports

CVE List Score used 2.1

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

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.

Record
CVE-2026-59727
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Weakness
CWE-79, CWE-83, CWE-116
Updated
2026-11-02
EUVDEUVD-2026-49581 2.1

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.

Record
EUVD-2026-49581
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-7pw4-f3q4-r2p2 2.1

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

Summary

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

Severity

Although a generic reflected XSS scores in the Medium range, exploitation here 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 mitigating precondition places the real-world severity at Low.

Details

In generateHydrateScript() (packages/astro/src/runtime/server/hydration.ts), every island property is HTML-escaped before serialization — the attrs, props, and opts assignments all pass through escapeHTML(). The transition directives, however, were copied verbatim:

transitionDirectivesToCopyOnIsland.forEach((name) => {
  if (typeof props[name] !== 'undefined') {
    island.props[name] = props[name]; // not escaped
  }
});

The <astro-island> element is serialized via renderElement('astro-island', island, false) with shouldEscape=false, and toAttributeString() returns the value unchanged in that mode. As a result there is no downstream re-escaping, and the raw directive value reaches the HTML response. This is the same output sink previously addressed for slot names in GHSA-8hv8-536x-4wqp.

The affected directives are:

  • data-astro-transition-scope (transition:scope)
  • data-astro-transition-persist (transition:persist)
  • data-astro-transition-persist-props (transition:persist-props)

Note that transition:persist is typed boolean | string, so passing a string value is a supported use of the API.

Proof of Concept

A component that reflects a query parameter into a transition directive:

---
const persist = Astro.url.searchParams.get('persist') ?? 'default';
---
<Island client:load transition:persist={persist} />

Request:

https://example.com/?persist="><img src=x onerror=alert(document.domain)>

Rendered output (before the fix):

<astro-island … data-astro-transition-persist=""><img src=x onerror=alert(document.domain)>></astro-island>

The " closes the attribute and the injected <img onerror=…> executes in the victim's browser.

Impact

Reflected XSS. An attacker who can induce a victim to visit a crafted URL can execute arbitrary script in the victim's session on the origin, subject to the requirement that the target application reflects untrusted input into one of the affected transition directives.

Affected Versions

astro >= 3.10.0, < 7.0.4 (introduced in 3.10.0, PR #7861).

Patched Versions

astro >= 7.0.4. Fixed in PR #17212 by HTML-escaping transition directive values before they are rendered onto the island element.

Workarounds

Do not pass untrusted or request-derived input into transition:persist, transition:scope, or transition:persist-props. If such input is required, HTML-escape or strictly validate it before passing it to the directive. Upgrading to [email protected] or later removes the need for manual mitigation.

Credits

Reported by @jlgore.

Record
GHSA-7pw4-f3q4-r2p2
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Weakness
CWE-79, CWE-83, CWE-116
Updated
2026-11-02
NVD 2.1

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.

Record
CVE-2026-59727
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Weakness
CWE-79, CWE-83, CWE-116
Updated
2026-11-02
OSV 2.1

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

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.

Record
CVE-2026-59727
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Weakness
CWE-116, CWE-79, CWE-83
Updated
2026-11-02
OSVGHSA-7pw4-f3q4-r2p2 2.1

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

Summary

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

Severity

Although a generic reflected XSS scores in the Medium range, exploitation here 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 mitigating precondition places the real-world severity at Low.

Details

In generateHydrateScript() (packages/astro/src/runtime/server/hydration.ts), every island property is HTML-escaped before serialization — the attrs, props, and opts assignments all pass through escapeHTML(). The transition directives, however, were copied verbatim:

transitionDirectivesToCopyOnIsland.forEach((name) => {
  if (typeof props[name] !== 'undefined') {
    island.props[name] = props[name]; // not escaped
  }
});

The <astro-island> element is serialized via renderElement('astro-island', island, false) with shouldEscape=false, and toAttributeString() returns the value unchanged in that mode. As a result there is no downstream re-escaping, and the raw directive value reaches the HTML response. This is the same output sink previously addressed for slot names in GHSA-8hv8-536x-4wqp.

The affected directives are:

  • data-astro-transition-scope (transition:scope)
  • data-astro-transition-persist (transition:persist)
  • data-astro-transition-persist-props (transition:persist-props)

Note that transition:persist is typed boolean | string, so passing a string value is a supported use of the API.

Proof of Concept

A component that reflects a query parameter into a transition directive:

---
const persist = Astro.url.searchParams.get('persist') ?? 'default';
---
<Island client:load transition:persist={persist} />

Request:

https://example.com/?persist="><img src=x onerror=alert(document.domain)>

Rendered output (before the fix):

<astro-island … data-astro-transition-persist=""><img src=x onerror=alert(document.domain)>></astro-island>

The " closes the attribute and the injected <img onerror=…> executes in the victim's browser.

Impact

Reflected XSS. An attacker who can induce a victim to visit a crafted URL can execute arbitrary script in the victim's session on the origin, subject to the requirement that the target application reflects untrusted input into one of the affected transition directives.

Affected Versions

astro >= 3.10.0, < 7.0.4 (introduced in 3.10.0, PR #7861).

Patched Versions

astro >= 7.0.4. Fixed in PR #17212 by HTML-escaping transition directive values before they are rendered onto the island element.

Workarounds

Do not pass untrusted or request-derived input into transition:persist, transition:scope, or transition:persist-props. If such input is required, HTML-escape or strictly validate it before passing it to the directive. Upgrading to [email protected] or later removes the need for manual mitigation.

Credits

Reported by @jlgore.

Record
GHSA-7pw4-f3q4-r2p2
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Weakness
CWE-116, CWE-79, CWE-83
Updated
2026-11-02
Show 12 moreShow less
OSVCLSA-2026-1784596296 No score

TuxCare security update for astro (2 CVEs)

TuxCare rebuilt astro to address 2 CVEs. Fixed in 5.18.1-tuxcare.5.

Record
CLSA-2026-1784596296
Updated
2026-11-02
OSVCLSA-2026-1786365605 No score

TuxCare security update for 5 packages (4 CVEs)

TuxCare rebuilt 5 packages to address 4 CVEs. Fixed in 4.16.19-tuxcare.3.

Record
CLSA-2026-1786365605
Updated
2026-11-02
OSVCLSA-2026-1792160941 No score

TuxCare security update for @astrojs/internal-helpers (4 CVEs)

TuxCare rebuilt @astrojs/internal-helpers to address 4 CVEs. Fixed in 4.16.19-tuxcare.3.

Record
CLSA-2026-1792160941
Updated
2026-11-02
OSVCLSA-2026-1792161554 No score

TuxCare security update for @astrojs/internal-helpers (2 CVEs)

TuxCare rebuilt @astrojs/internal-helpers to address 2 CVEs. Fixed in 5.18.1-tuxcare.5.

Record
CLSA-2026-1792161554
Updated
2026-11-02
OSVCLSA-2026-1792161693 No score

TuxCare security update for @astrojs/prism (2 CVEs)

TuxCare rebuilt @astrojs/prism to address 2 CVEs. Fixed in 5.18.1-tuxcare.5.

Record
CLSA-2026-1792161693
Updated
2026-11-02
OSVCLSA-2026-1792161702 No score

TuxCare security update for @astrojs/prism (4 CVEs)

TuxCare rebuilt @astrojs/prism to address 4 CVEs. Fixed in 4.16.19-tuxcare.3.

Record
CLSA-2026-1792161702
Updated
2026-11-02
OSVCLSA-2026-1792161761 No score

TuxCare security update for @astrojs/studio (4 CVEs)

TuxCare rebuilt @astrojs/studio to address 4 CVEs. Fixed in 4.16.19-tuxcare.3.

Record
CLSA-2026-1792161761
Updated
2026-11-02
OSVCLSA-2026-1792161785 No score

TuxCare security update for @astrojs/underscore-redirects (2 CVEs)

TuxCare rebuilt @astrojs/underscore-redirects to address 2 CVEs. Fixed in 5.18.1-tuxcare.5.

Record
CLSA-2026-1792161785
Updated
2026-11-02
OSVCLSA-2026-1792161790 No score

TuxCare security update for @astrojs/underscore-redirects (4 CVEs)

TuxCare rebuilt @astrojs/underscore-redirects to address 4 CVEs. Fixed in 4.16.19-tuxcare.3.

Record
CLSA-2026-1792161790
Updated
2026-11-02
OSVCLSA-2026-1792161854 No score

TuxCare security update for @astrojs/upgrade (2 CVEs)

TuxCare rebuilt @astrojs/upgrade to address 2 CVEs. Fixed in 5.18.1-tuxcare.5.

Record
CLSA-2026-1792161854
Updated
2026-11-02
OSVCLSA-2026-1792161857 No score

TuxCare security update for @astrojs/upgrade (4 CVEs)

TuxCare rebuilt @astrojs/upgrade to address 4 CVEs. Fixed in 4.16.19-tuxcare.3.

Record
CLSA-2026-1792161857
Updated
2026-11-02
OSVCLSA-2026-1792454046 No score

TuxCare security update for astro (9 CVEs)

TuxCare rebuilt astro to address 9 CVEs. Fixed in 5.18.2-tuxcare.1.

Record
CLSA-2026-1792454046
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
astro
npm
3.10.0 up to 7.0.4
7.0.4
astro
TuxCare:npm
From an advisory covering 2 CVEs
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.5, plus listed versions
5.18.15.18.1-tuxcare.15.18.1-tuxcare.25.18.1-tuxcare.35.18.1-tuxcare.4
5.18.1-tuxcare.5
@astrojs/db
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
@astrojs/rss
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
@astrojs/telemetry
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
astro
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
create-astro
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
@astrojs/internal-helpers
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
@astrojs/internal-helpers
TuxCare:npm
From an advisory covering 2 CVEs
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.5, plus listed versions
5.18.15.18.1-tuxcare.25.18.1-tuxcare.35.18.1-tuxcare.4
5.18.1-tuxcare.5
@astrojs/prism
TuxCare:npm
From an advisory covering 2 CVEs
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.5, plus listed versions
5.18.15.18.1-tuxcare.25.18.1-tuxcare.35.18.1-tuxcare.4
5.18.1-tuxcare.5
Show 7 moreShow less
Affected packages
PackageAffectedFixed
@astrojs/prism
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
@astrojs/studio
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
@astrojs/underscore-redirects
TuxCare:npm
From an advisory covering 2 CVEs
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.5, plus listed versions
5.18.15.18.1-tuxcare.25.18.1-tuxcare.35.18.1-tuxcare.4
5.18.1-tuxcare.5
@astrojs/underscore-redirects
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
@astrojs/upgrade
TuxCare:npm
From an advisory covering 2 CVEs
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.5, plus listed versions
5.18.15.18.1-tuxcare.25.18.1-tuxcare.35.18.1-tuxcare.4
5.18.1-tuxcare.5
@astrojs/upgrade
TuxCare:npm
From an advisory covering 3 CVEs
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.3, plus listed versions
4.16.194.16.19-tuxcare.14.16.19-tuxcare.2
4.16.19-tuxcare.3
astro
TuxCare:npm
From an advisory covering 9 CVEs
5.18.2-tuxcare.0 up to 5.18.2-tuxcare.1, plus listed versions
5.18.2
5.18.2-tuxcare.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-59727 is a low vulnerability (CVSS 2.1) in Withastro Astro, published July 20, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.39%, the 33rd percentile. Fixed in astro 7.0.4.

References

MoveEnter Open