Intel

AIKIDO-2026-570094

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

Cross-Site Scripting (XSS)GHSA-8m5h-gv5q-jmp5 Published 5 days ago

51

Medium Risk

This Affects:

PHPleague/html-to-markdown
3.0.0 - 5.1.2
Fixed in 5.1.3
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.

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.

Background info

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

How to fix this

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

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform