lazy_html is vulnerable to Cross-Site Scripting (XSS)
23
Low Risk
LazyHTML.Tree.to_html/2 decides whether to escape an element's text children only from the tag name being style, script, or another raw text tag, without checking the element's namespace. An SVG or MathML style/script element can carry untrusted text with encoded character references, so serializing it back to HTML re-emits that text unescaped and reintroduces markup a tree based sanitizer already approved. Reparsing the serialized output after a to_tree/1 to postwalk/3 to to_html/2 round trip can turn that text into executing markup (mutation XSS). The fix tracks the element namespace through serialization and only treats style/script as raw text inside the HTML namespace.
You are affected if you are using a version that falls within the vulnerable range and you serialize parsed HTML trees that can contain untrusted SVG or MathML markup, for example when sanitizing HTML from an untrusted source.
lazy_html is vulnerable to Cross-Site Scripting (XSS) in versions 0.1.0 - 0.1.12.
Upgrade the lazy_html library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

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.