All vulnerabilities

Servers and applications

CVE-2026-59729

XSS via unescaped spread attribute names in custom element rendering

Severity
Low
Published
17 Jul 2026
Last changed
17 Jul 2026
Added to UpHeron
3 Nov 2026
Fixed in
7.0.5
Exploit chance
0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Cross-site scripting (CWE-79)
Also known as
GHSA-f48w-9m4c-m7f5
Sources
Project advisories (GitHub)

Description

The fix for CVE-2026-54298 (GHSA-jrpj-wcv7-9fh9) added an INVALID_ATTR_NAME_CHAR guard to addAttribute() so that spread-prop attribute names containing "' >/= or whitespace are dropped. A second attribute-rendering path, renderHTMLElement() in packages/astro/src/runtime/server/render/dom.ts, has its own inline attribute loop that does not go through addAttribute() and was not updated. It interpolates the attribute name unescaped and only escapes the value, so untrusted prop keys spread onto a native-HTMLElement-subclass component can still break out of the attribute context, resulting in XSS.

renderHTMLElement builds attributes directly:

The attribute name (attr) is interpolated raw; only the value is escaped via toAttributeString. By contrast, the hardened addAttribute in util.ts rejects invalid names:

renderHTMLElement is reached from component.ts when the component is a native HTMLElement subclass:

where _props carries spread props verbatim.

From withastro/astro's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
AstroServers and applications · github:withastro/astro
  • Every version before 7.0.5

About Astro

The web framework for content-driven websites.

From its GitHub repository.
Developers who used it in the past year
4.5%Stack Overflow Developer Survey 2025, 2025
Weekly downloads (npm)
11,910,147npm, 15 Nov 2026
GitHub stars
63,954GitHub, 15 Nov 2026
Forks
3,922GitHub, 15 Nov 2026
Latest release
@astrojs/[email protected]GitHub, 15 Nov 2026
Released
13 Nov 2026GitHub
First published on GitHub
15 Mar 2021GitHub

References