# CVE-2026-59729: withastro Astro XSS in renderHTMLElement spread attributes

Source: https://junglewise.ai/threats/cve-2026-59729-withastro-astro-xss-in-renderhtmlelement-spread-attributes  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-27. Updated: 2026-07-27  
License: CC BY 4.0 with a link back

CVE-2026-59729 · Severity: medium · CVSS 4 · Published 2026-07-27

Astro, a web framework for building content-driven websites, is vulnerable to a security flaw that could allow attackers to execute malicious scripts in a user's browser. This occurs when the framework fails to properly clean up attribute names when rendering certain types of custom HTML elements during server-side processing. If an attacker can control the names of properties passed to these elements, they could bypass security filters to steal user data or perform unauthorized actions on behalf of the user.

Technologies: [astro (npm)](https://junglewise.ai/threats/technologies/astro). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-59729 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-59729 being exploited in the wild.

**How severe is CVE-2026-59729?** Medium severity, with a CVSS score of 4, published 27 July 2026.

**Which products and versions are affected?** astro (npm) < 7.0.6, SEMVER:introduced=0,fixed=7.0.6.

**Is there a fix for CVE-2026-59729?** Yes. astro (npm): upgrade to 7.0.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-59729 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-59729?** Check whether you run astro (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- astro (npm): upgrade to 7.0.6 or later

  ```sh
  npm install astro@7.0.6
  ```


## Technical details

A cross-site scripting (XSS) vulnerability exists in Astro's server-side rendering (SSR) runtime. While a previous fix (CVE-2026-54298) hardened the 'addAttribute' function, a separate rendering path in 'renderHTMLElement' (packages/astro/src/runtime/server/render/dom.ts) was overlooked. This path interpolates attribute names raw while only escaping the values. An attacker can provide malicious property keys containing characters like quotes, brackets, or whitespace to inject event handlers or script tags. This is reachable when the SSR environment (such as Deno, Bun, or Node with a DOM shim) defines a global HTMLElement and a native HTMLElement subclass is used as a component. The issue is fixed in version 7.0.6.

## Affected products

- withastro Astro < 7.0.6

## Identifiers

- CVE-2026-59729
- GHSA-f48w-9m4c-m7f5

## Timeline

- 2026-07-01: disclosed: Pull request submitted to fix the issue
- 2026-07-02: patched: Version 7.0.6 released
- 2026-07-27: advisory: CVE-2026-59729 published

## References

- [https://github.com/withastro/astro/commit/5240e26c9dd91f9bc7140dcfacdb48d5a132830d](https://github.com/withastro/astro/commit/5240e26c9dd91f9bc7140dcfacdb48d5a132830d)
- [https://github.com/withastro/astro/pull/17251](https://github.com/withastro/astro/pull/17251)
- [https://github.com/withastro/astro/releases/tag/astro@7.0.6](https://github.com/withastro/astro/releases/tag/astro@7.0.6)
- [https://github.com/withastro/astro/security/advisories/GHSA-f48w-9m4c-m7f5](https://github.com/withastro/astro/security/advisories/GHSA-f48w-9m4c-m7f5)

## Related threats

- [Astro HTML injection in script and style element rendering](https://junglewise.ai/threats/cve-2026-114128-astro-is-a-web-framework-for-content-driven-websites-prior-to-7)
- [Astro CSS injection in View Transition animation values](https://junglewise.ai/threats/cve-2026-114127-astro-is-a-web-framework-for-content-driven-websites-from-7-1-0)
- [Astro remote code execution via AVIF image processing](https://junglewise.ai/threats/astro-remote-code-execution-via-avif-image-processing-6b99ffe8)
- [Astro authorization bypass in base path stripping](https://junglewise.ai/threats/cve-2026-84376-astro-authorization-bypass-in-base-path-stripping)
- [Astro composable astro/hono pipeline CSRF via origin check bypass](https://junglewise.ai/threats/cve-2026-73423-astro-composable-astro-hono-pipeline-csrf-via-origin-check-bypass)
