Astro: XSS via unescaped code for unsupported languages in @astrojs/prism
- State
- Published
- Severity
- 5.4 Medium
- Published
- Nov 12, 2026
- Updated
- Nov 17, 2026
- Reserved
- Nov 10, 2026
Description
Astro is a web framework for content-driven websites. Prior to @astrojs/prism 4.1.2, and from @astrojs/markdoc 0.3.0 until 2.1.2, runHighlighterWithAstro() returned code unchanged when Prism had no grammar for the requested language, and callers inserted that result as raw HTML. A code block labeled with an unsupported language could therefore render embedded HTML and script instead of displaying it as text. The Prism component was affected when applications supplied untrusted code with an unsupported or attacker-controlled lang, and the @astrojs/markdoc prism() extension was affected for less-trusted content authors even when Markdoc's ordinary HTML rendering was disabled. This issue is fixed in @astrojs/prism 4.1.2 and @astrojs/markdoc 2.1.2.
| Product | Versions |
|---|---|
| astro withastro | < 7.4.3 Affected |
| prism @astrojs | < 4.1.2 Affected |
| markdoc @astrojs | >= 0.3.0, < 2.1.2 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 3.1 | 5.4 Medium | GitHub_M |
Weaknesses
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.