Astro: XSS via unescaped code for unsupported languages in @astrojs/prism
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. No fixed version is recorded.
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.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| @astrojs | >=0.3.0 <2.1.2, <4.1.2 | ||
| withastro | <7.4.3 |
Timeline
Every event on this vulnerability
Embed
A live severity badge for an advisory, README or ticket