Intel

AIKIDO-2026-436039

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

GHSA-r2cp-59h5-vgjjPublished Oct 13, 2026
October 13, 2026

50

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

LinkConverter and ImageConverter build Markdown links and images by concatenating the element's href/src, title, and alt attribute values without escaping them. A double quote in title, a closing bracket in alt, or an unbalanced closing parenthesis in the URL ends the link or image syntax early, and the entity decoded remainder of the value is emitted as raw Markdown or HTML. HTML Purifier and the strip_tags/remove_nodes options do not stop this because the attribute value contains no tags before conversion runs. The fix escapes link and image text and destinations before they are written into the output.

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