lazy_html is vulnerable to Cross-Site Scripting (XSS)
23
CVE Score
Low
Cross-Site Scripting (XSS)
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.
Upgrade the lazy_html library to the patch version.
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.
0.1.0 - 0.1.12
Fixed in 0.1.13lazy_html is vulnerable to Cross-Site Scripting (XSS) in versions 0.1.0 - 0.1.12.
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.