Intel

AIKIDO-2026-154288

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

GHSA-vc6h-86x6-wcjgPublished Oct 9, 2026
October 9, 2026

50

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

When strip_tags is disabled (the default), DefaultConverter, DivConverter, and LinkConverter keep tags without a Markdown equivalent by serializing the element and entity-decoding the whole result, including its start tag. Decoding the start tag turns an encoded quote inside an attribute value into a literal quote, ending that attribute early and letting the remainder of the value add new attributes such as event handlers. The input passes HTML Purifier because it holds one correctly encoded attribute and no <script> element or event handler attribute until after conversion. The fix stops entity-decoding the start tag of preserved elements.

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