league/html-to-markdown is vulnerable to Cross-Site Scripting (XSS)
50
CVE Score
Medium
Cross-Site Scripting (XSS)
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.
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.