Servers and applications
GHSA-r7x2-725f-h4m9
XSS via unescaped object values in JSX and MDX elements
- Severity
- Medium 6.1
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 7.4.14
- Weakness
- CWE-87
- Attack
- Over the network · No login needed · Needs someone to click or open something
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Sources
- Project advisories (GitHub)
Description
Astro escapes dynamic values in templates before rendering them as HTML, but only when the value was a string. Other values that turn into text, such as an Error, a String object, a Node.js Buffer, or any object with a custom toString(), were converted to a string and rendered without escaping.
This affected .astro templates, JSX and MDX. In JSX and MDX it also affected set:text, which is documented to escape its value.
For example:
rendered `
Error: Post "
" not found
as live HTML. In JSX and MDX, {new String(value)}, {Buffer.from(value)} and
` were rendered unescaped in the same way.
Reflected or stored cross-site scripting, but only in applications that render untrusted input inside a non-string value, such as an error message built from a request parameter or a buffer read from user-supplied content. String values were always escaped.
Workarounds
Upgrade to astro 7.4.14 or later. Before upgrading, convert values to strings before rendering them, for example {String(error)} or {error.message}, so that Astro escapes them.
Affected software
| Software | Affected versions |
|---|---|
AstroServers and applications · github:withastro/astro |
|
About Astro
The web framework for content-driven websites.
- Developers who used it in the past year
- 4.5%Stack Overflow Developer Survey 2025, 2025
- Weekly downloads (npm)
- 12,020,872npm, 29 Nov 2026
- GitHub stars
- 64,305GitHub, 29 Nov 2026
- Forks
- 3,943GitHub, 29 Nov 2026
- Latest release
- @astrojs/[email protected]GitHub, 29 Nov 2026
- Released
- 18 Nov 2026GitHub
- First published on GitHub
- 15 Mar 2021GitHub
Vulnerabilities in Astro
- In our list
- 35
- Published in the last 12 months
- 22
- Critical, last 12 months
- 1
- High, last 12 months
- 2
- Known exploited
- 0
- GHSA-3285-4h5r-3q5xAuthorization bypass in middleware via double-encoded action namesMedium 4.8 2 Dec 2026
- GHSA-c335-jqf9-8wmcReflected XSS via data URIs with an allow-listed host in the image endpointMedium 6.1 2 Dec 2026
- CVE-2026-126365Astro: XSS via unescaped code for unsupported languages in @astrojs/prismMedium 5.4 12 Nov 2026
- CVE-2026-126363Astro: Reflected XSS via unescaped slot names in @astrojs/solid-jsLow 2.3 12 Nov 2026
- CVE-2026-126362Astro: Reflected XSS via unescaped slot names in @astrojs/svelteLow 2.3 12 Nov 2026
- CVE-2026-126364Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystemsMedium 6.3 9 Nov 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-r7x2-725f-h4m9
- github.com https://github.com/withastro/astro/security/advisories/GHSA-r7x2-725f-h4m9