Cross-site scripting in @astrojs/prism and @astrojs/markdoc
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-79.
Summary
The @astrojs/prism package before 4.1.2 and @astrojs/markdoc from 0.3.0 before 2.1.2 are affected, and the withastro astro package before 7.4.3 is also listed as affected. When Prism has no grammar for a code block's language, the code is returned unchanged and inserted as raw HTML, which is a cross-site scripting flaw (CWE-79). An attacker who supplies untrusted code or an attacker-controlled language value can make embedded HTML and script render instead of displaying as text, and content authors with limited trust can trigger it even when Markdoc's HTML rendering is disabled.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the CNA
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Update @astrojs/prism to 4.1.2, @astrojs/markdoc to 2.1.2, and astro to 7.4.3.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · CNA astro (withastro) Fixed in 7.4.3
- Fix · CNA prism (@astrojs) Fixed in 4.1.2
- Fix · CNA markdoc (@astrojs) Fixed in 2.1.2
Timeline
- 2026-11-12 Threatist record created from CVE-2026-126365
References
Other 4
- https://github.com/withastro/astro/security/advisories/GHSA-ff38-p3qj-4pmf
- https://github.com/withastro/astro/commit/edfbf4ab34ff007ae8f7188af76a023a15c9443d
- https://github.com/withastro/astro/releases/tag/@astrojs/[email protected]
- https://github.com/withastro/astro/releases/tag/@astrojs/[email protected]
More withastro vulnerabilities
- TI-2026-26147 Astro: Unauthenticated Path Override via `x-astro-path` / `x_astro_path` CVSS 3.1CRITICAL 9.1
- TI-2026-42600 Astro 6.4.7 Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch CVSS 3.1HIGH 8.2
- TI-2024-37142 Server source code is exposed to the public if sourcemaps are enabled CVSS 4.0HIGH 7.8
- TI-2025-35987 Astro Cloudflare adapter is vulnerable to Server-Side Request Forgery via /_image endpoint CVSS 3.1HIGH 7.2
- TI-2025-34958 Unauthorized third-party images in Astro’s _image endpoint CVSS 4.0MEDIUM 6.9
- TI-2026-51542 Astro: Unauthenticated path override in the @astrojs/vercel ISR function CVSS 3.1MEDIUM 6.5
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences