CVE-2026-54298

Astro: XSS via Unescaped Attribute Names in Spread Props

Published Jun 22, 2026 CVSS 3.1 · 4.2 Medium EPSS < 1% KEV · Not listed
Description
Astro is a web framework. Prior to 6.4.6, the spreadAttributes function in Astro's server-side rendering pipeline iterates over object keys and passes them directly to addAttribute, which interpolates the key into the HTML output without escaping. When a developer uses the spread syntax {...props} on an HTML element and the object keys come from an untrusted source (API, CMS, URL parameters), an attacker can inject arbitrary HTML attributes including event handlers like onmousemove, onclick, or break out of the attribute context entirely to inject new elements. This vulnerability is fixed in 6.4.6.

Analysis

AI-generated

Technical impact

Astro, the JavaScript web framework, has a flaw in its server‑side rendering routine in versions older than 6.4.6. The spreadAttributes function loops over the keys of an object and inserts each key into HTML output unchanged. If the object keys come from an untrusted source, the attacker can place arbitrary attribute names, including malicious event handlers (e.g. onmousemove, onclick) or characters that break out of the attribute context to inject additional HTML elements. This enables client‑side script execution in users’ browsers, compromising confidentiality and integrity of the web page and potentially delivering phishing or malware payloads. The weakness is a classic input‑validation error classified as CWE‑79.

Affected Systems

All installations of the Astro framework using versions prior to 6.4.6 are affected. The issue was fixed in Astro 6.4.6; any deployment that still depends on older releases of `${Astro}` is vulnerable, regardless of the hosting environment.

Risk and Exploitability

The CVSS score of 4.2 indicates a low to moderate severity. Because the flaw can be triggered by any user who can supply props to a component, no additional authentication is required, and it may be exploited over the internet wherever the vulnerable application is exposed. EPSS data is not available, and the entry is not listed in the CISA KEV catalog, suggesting no confirmed exploits yet. Nonetheless, the ability to execute arbitrary JavaScript in the victim’s browser makes this a significant security risk for any public‑facing Astro application.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Astro to version 6.4.6 or later where the spreadAttributes function properly escapes attribute names
  • If an upgrade is not immediately possible, ensure that any object keys passed to the spread syntax are first validated and sanitized so that only trusted, predefined attribute names are allowed
  • Consider configuring a Content Security Policy to restrict execution of inline scripts, providing an additional defensive layer against potential XSS payloads.

Generated by OpenCVE AI on June 22, 2026 at 19:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-jrpj-wcv7-9fh9 Astro: XSS via Unescaped Attribute Names in Spread Props
History
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Withastro
Withastro astro
Vendors & Products Withastro
Withastro astro
Type Values Removed Values Added
Description Astro is a web framework. Prior to 6.4.6, the spreadAttributes function in Astro's server-side rendering pipeline iterates over object keys and passes them directly to addAttribute, which interpolates the key into the HTML output without escaping. When a developer uses the spread syntax {...props} on an HTML element and the object keys come from an untrusted source (API, CMS, URL parameters), an attacker can inject arbitrary HTML attributes including event handlers like onmousemove, onclick, or break out of the attribute context entirely to inject new elements. This vulnerability is fixed in 6.4.6.
Title Astro: XSS via Unescaped Attribute Names in Spread Props
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 4.2, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N'}

Weaknesses
  • CWE-79

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 23, 2026, 4:11 PM
Reserved
Jun 12, 2026, 5:46 PM
Status
Modified
Published
Jun 22, 2026, 7:17 PM
Modified
Oct 25, 2026, 11:10 PM