CVE-2026-126365
Received Received - Intake

XSS via Unsupported Prism Language in Astro Framework

Vulnerability report for CVE-2026-126365, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-11-13

Last updated on: 2026-11-13

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-11-13
Last Modified
2026-11-13
Generated
2026-11-13
AI Q&A
2026-11-13
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Showing 3 associated CPEs
Vendor Product Version / Range
astrojs markdoc 2.1.2
astrojs prism 4.1.2
astrojs markdoc From 0.3.0 (inc) to 2.1.2 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability affects the Astro framework's Prism syntax highlighting. When a code block uses an unsupported language like Vue or Svelte, Prism returns the code unchanged instead of escaping it. This raw code is then inserted as HTML, allowing embedded scripts or HTML to execute in the browser, leading to a stored cross-site scripting (XSS) attack.

Detection Guidance

Check if your Astro project uses @astrojs/prism versions before 4.1.2 or @astrojs/markdoc versions between 0.3.0 and 2.1.2. Inspect code blocks in your application for unsupported languages like Vue or Svelte rendered as HTML. Review server logs for unexpected script executions or HTML injections in rendered content.

Impact Analysis

If you use @astrojs/prism or @astrojs/markdoc with untrusted content, attackers could inject malicious scripts via unsupported language labels in code blocks. This could lead to data theft, session hijacking, or defacement of your website. The risk is higher if untrusted users can contribute content.

Compliance Impact

This vulnerability could lead to cross-site scripting (XSS) attacks by rendering unsupported code blocks as raw HTML or JavaScript. This may violate GDPR's requirement for data integrity and security (Article 32) and HIPAA's safeguards for protecting electronic protected health information (ePHI) from unauthorized access or alteration.

Mitigation Strategies

Update @astrojs/prism to version 4.1.2 or later and @astrojs/markdoc to version 2.1.2 or later. If using Markdoc's prism() extension, switch to Shiki for syntax highlighting as a temporary workaround. Avoid allowing untrusted users to contribute content with unsupported language labels until patched.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-126365. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...