league/html-to-markdown is vulnerable to Cross-Site Scripting (XSS)
51
CVE Score
Medium
Cross-Site Scripting (XSS)
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.
Upgrade the league/html-to-markdown library to the patch version.
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.
3.0.0 - 5.1.2
Fixed in 5.1.3league/html-to-markdown is vulnerable to Cross-Site Scripting (XSS) in versions 3.0.0 - 5.1.2.
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.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.