Multiple security vulnerabilities have been identified in lxml-html-clean, an HTML sanitization package, affecting version 0.4.0. The issues involve incomplete sanitization of crafted HTML in certain non-default configurations, allowing script execution after cleaning. Overall risk is moderate, primarily for applications that render cleaned user-supplied content. The flaws can lead to cross-site scripting when the output is displayed in a browser, but they require specific cleaner settings and attacker-controlled markup.
CVE-2026-141555 (CVSS 4.7 — Medium): When the cleaner is configured to preserve comments, it can retain a comment inside a noscript element that a browser interprets as closing that element. An unauthenticated remote attacker can supply crafted HTML that executes script when the cleaned output is rendered, without requiring a user click.[/subscribe_to_unlock_form]
Multiple security vulnerabilities have been identified in lxml-html-clean, an HTML sanitization package, affecting version 0.4.0. The issues involve incomplete sanitization of crafted HTML in certain non-default configurations, allowing script execution after cleaning. Overall risk is moderate, primarily for applications that render cleaned user-supplied content. The flaws can lead to cross-site scripting when the output is displayed in a browser, but they require specific cleaner settings and attacker-controlled markup.
CVE-2026-141555 (CVSS 4.7 — Medium): When the cleaner is configured to preserve comments, it can retain a comment inside a noscript element that a browser interprets as closing that element. An unauthenticated remote attacker can supply crafted HTML that executes script when the cleaned output is rendered, without requiring a user click.[emaillocker id="1283"]
CVE-2026-141556 (CVSS 4.7 — Medium): When the cleaner is configured to allow non-safe attributes, it can retain javascript: URLs in iframe srcdoc and SVG animation attributes. An unauthenticated remote attacker can supply crafted HTML that executes script when the cleaned output is rendered, either automatically in an embedded frame or after a user interaction with an SVG link.
These vulnerabilities collectively present a moderate cross-site scripting risk for applications that sanitize untrusted HTML with the affected package. Users who process user-supplied content with non-default cleaner settings are most at risk. They should assess exposure and take appropriate action to reduce the risk.
We recommend you to update lxml-html-clean to version 0.4.7.
The following reports contain further technical details:
[/emaillocker]