Servers and applications
CVE-2026-126361
XSS via attribute injection in dynamic tag names
- Severity
- Low 2.3
- Published
- 9 Nov 2026
- Last changed
- 12 Nov 2026
- Added to UpHeron
- 12 Nov 2026
- Fixed in
- 7.4.5
- Attack
- Over the network · Only under certain conditions · No login needed · Needs someone to view a page or file
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N- Also known as
- GHSA-mh32-jxcr-mh9f
- Sources
- CVE Program, Project advisories (GitHub)
Description
When a dynamic tag (const Tag = ...; ) resolves to a string, Astro renders it as a raw HTML element name. The name was filtered to remove characters that could inject attributes, but the filter did not handle /. Because HTML parsers treat / inside a tag as an attribute separator, a tag name such as img/src/onerror=alert(1) was rendered as an element with an onerror` attribute. The JSX renderer used for MDX did not filter string tag names at all.
For example:
rendered ?as=img/src/onerror=alert(1) as live HTML.
Reflected or stored cross-site scripting, but only in applications that use untrusted input (such as a request parameter or an uncontrolled CMS field) as all or part of an element name. Astro itself never derives element names from request data.
Applications that let content choose an element should map that input to a fixed set of known tags. Letting untrusted input choose an element name is unsafe even with a correct filter, because it can still select elements such as…
Workarounds
Upgrade to astro 7.4.5 or later. Before upgrading, do not use untrusted input as an element name, or map it to a fixed set of known tags.
Affected software
| Software | Affected versions |
|---|---|
AstroServers and applications · cna:withastro|astro |
|
AstroServers and applications · github:withastro/astro |
|
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-126361
- GitHub Advisory Database https://github.com/advisories/GHSA-mh32-jxcr-mh9f
- github.com https://github.com/withastro/astro/security/advisories/GHSA-mh32-jxcr-mh9f