CSIRTS // UNIFIED SECURITY ADVISORY FEEDSYS ● ONLINE · POWERED BY INTELFUSIONS.COM

CVE-2026-54298

mediumCVSS 4.2covered by 1 sourcefirst seen 2026-06-16
Summary 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. Details The vulnerable function is addAttribute at packages/astro/src/runtime/server/render/util.ts:81-141: export function addAttribute(value: any, key: string, shouldEscape = true, tagName = '') { if (value == null) { return ''; } return markHTMLString( ${key}="${toAttributeString(value, shouldEscape)}"); // key interpolated not escaped } This function is called from spreadAttributes at packages/astro/src/runtime/server/index.ts:91-92: for (const [key, value] of Object.entries(values)) { output += addAttribute(value, key, true, _name); } The toAttributeString function escapes the attribute value, but the attribute name key is never validated or escaped. An attacker can craft a JSON object with a key containing " characters to break out of the attribute context and inject event handlers. Execution flow: User controlled object keys (from API, CMS, URL params) are spread onto element via {...props}. The compiler generates spreadAttributes(props) which iterates with Object.entries() and calls addAttribute(value, key). The key is interpolated as ${key}="${escapedValue}" . A malicious key breaks attribute context, resulting in XSS. POC Create an SSR Astro page (src/pages/index.astro): const props = JSON.parse(Astro.url.searchParams.get('props') || '{}'); <html> <body> <h1>Hello</h1> <div {...props}>Move mouse here</div> </body> </html> Enable SSR in astro.config.mjs (for URL based demo): export default defineConfig({ output: 'serve

⚡ Watch CVE-2026-54298

Get an email if CVE-2026-54298 is added to CISA KEV, gains public exploit code, or a new advisory cites it — max one per day, one-click unsubscribe.

Exploitation outlook

Advisory coverage (1)

External references

NVD record for CVE-2026-54298

CVE.org record

Embed the live status

CVE-2026-54298 live status badge — this badge updates automatically when the KEV or exploit status changes. How to embed it →

[![CVE-2026-54298 status](https://www.csirts.com/badge/CVE-2026-54298)](https://www.csirts.com/cve/CVE-2026-54298)