Description
Astro is a web framework for content-driven websites. Versions prior to 7.0.6 are vulnerable to XSS through unescaped spread attribute names in renderHTMLElement. 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. This issue has been fixed in version 7.0.6.
Published: 2026-07-27
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A flaw in Astro’s renderHTMLElement function allows an attacker to inject unescaped attribute names into a native‑HTMLElement subclass component. The renderHTMLElement method contains an inline attribute loop that does not use the addAttribute guard, so the attribute name is interpolated directly into the output without proper escaping. This bypass lets an attacker break out of the attribute context and inject arbitrary JavaScript. The vulnerability is a classic client‑side XSS, classified as CWE‑79, and can lead to malicious script execution in the victim’s browser, enabling data theft, session hijacking, or defacement.

Affected Systems

Astro withastro/astro – all releases before version 7.0.6. The issue is resolved in release 7.0.6 and later. Any project using earlier Astro versions and rendering components that receive spread props from untrusted sources remains affected.

Risk and Exploitability

The CVSS score of 5.1 indicates moderate severity. The EPSS score of < 1% suggests a low but non‑zero likelihood of exploitation. The vulnerability is not listed in the CISA KEV catalog, indicating that large‑scale exploitation has not been observed to date. The flaw can be triggered through crafted data supplied to any component that accepts spread props from untrusted sources at runtime; the affected attribute name is rendered unescaped, providing a client‑side code execution path. Since the impact remains confined to the browser, an attacker can steal credentials or deface the site. Prompt patching is the most reliable mitigation.

Generated by OpenCVE AI on August 3, 2026 at 16:49 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Astro to version 7.0.6 or newer, which removes the vulnerable render overhead and sanitizes attribute names.
  • Audit all component usage to ensure that spread attributes are not applied to native‑HTMLElement subclasses with data that might originate from user input or third‑party services.
  • If an upgrade cannot be performed immediately, strip or encode any dynamic attribute names before they reach the render function, or replace the spread syntax with explicit assignments that validate the key names.

Generated by OpenCVE AI on August 3, 2026 at 16:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-f48w-9m4c-m7f5 Astro: XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298)
History

Tue, 28 Jul 2026 16:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 28 Jul 2026 03:30:00 +0000

Type Values Removed Values Added
First Time appeared Withastro
Withastro astro
Vendors & Products Withastro
Withastro astro

Mon, 27 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Description Astro is a web framework for content-driven websites. Versions prior to 7.0.6 are vulnerable to XSS through unescaped spread attribute names in renderHTMLElement. 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. This issue has been fixed in version 7.0.6.
Title Astro: XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298)
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-28T13:48:46.640Z

Reserved: 2026-07-06T15:34:16.917Z

Link: CVE-2026-59729

cve-icon Vulnrichment

Updated: 2026-07-28T13:48:33.738Z

cve-icon NVD

Status : Deferred

Published: 2026-07-27T20:16:40.303

Modified: 2026-07-28T16:17:16.127

Link: CVE-2026-59729

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T17:00:06Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')