Junglewise Threat Intelligence

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

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

Executive brief

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.

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

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

Related threats