Intel

AIKIDO-2026-570094

league/html-to-markdown is vulnerable to Cross-Site Scripting (XSS)

GHSA-8m5h-gv5q-jmp5Published Oct 9, 2026
October 9, 2026

51

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

PreformattedConverter and CodeConverter entity-decode the contents of <pre> and <code> elements and wrap the decoded text in a Markdown code fence or span chosen without regard to that content, so the content can end up outside the block or span and be parsed as ordinary Markdown. Because the content is already entity decoded, text that was inert in the input HTML becomes raw HTML in the Markdown output. HTML Purifier and the strip_tags/remove_nodes options do not prevent this since the payload contains no tags when inspected. The fix sets fence length and placement from the content so decoded text cannot escape its code block or span.

How do I fix this?

Upgrade the league/html-to-markdown library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and the converted Markdown is later rendered to HTML by a renderer that allows raw HTML.

Versions

3.0.0 - 5.1.2

Fixed in 5.1.3

Background info

league/html-to-markdown is vulnerable to Cross-Site Scripting (XSS) in versions 3.0.0 - 5.1.2.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea