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.
Published: 2026-06-22
Score: 4.2 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Mon, 22 Jun 2026 18:45:00 +0000

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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-06-22T17:33:15.734Z

Reserved: 2026-06-12T17:46:37.293Z

Link: CVE-2026-54298

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-22T19:30:06Z

Weaknesses
  • CWE-79

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