Intel

AIKIDO-2026-154288

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

Cross-Site Scripting (XSS)GHSA-vc6h-86x6-wcjg Published 4 days ago

50

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

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.

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