lxml-html-clean is an HTML cleaning library for Python. Prior to 0.4.7, Cleaner in lxml_html_clean/clean.py configured with comments=False uses kill_conditional_comments to remove conditional comments but retains other comments inside noscript. libxml2 parses the noscript content as markup and retains the comment as a node, while a browser with scripting enabled treats the content as raw text. A closing noscript tag inside a retained comment can terminate the element in the browser, causing following attacker-controlled markup to execute when cleaned HTML is rendered, without a click. The default Cleaner removes all comments, and the same comment outside noscript remains inert. An earlier check for a noscript closing tag applies to style text rather than retained comments. This issue is fixed in 0.4.7.
Metrics
Affected Vendors & Products
Advisories
| Source | ID | Title |
|---|---|---|
Github GHSA |
GHSA-vfhw-gfwp-vxfj | lxml_html_clean: Cleaner(comments=False) keeps a comment that closes <noscript> in the browser, which allows XSS |
Fixes
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
References
History
Wed, 02 Dec 2026 20:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Description | lxml-html-clean is an HTML cleaning library for Python. Prior to 0.4.7, Cleaner in lxml_html_clean/clean.py configured with comments=False uses kill_conditional_comments to remove conditional comments but retains other comments inside noscript. libxml2 parses the noscript content as markup and retains the comment as a node, while a browser with scripting enabled treats the content as raw text. A closing noscript tag inside a retained comment can terminate the element in the browser, causing following attacker-controlled markup to execute when cleaned HTML is rendered, without a click. The default Cleaner removes all comments, and the same comment outside noscript remains inert. An earlier check for a noscript closing tag applies to style text rather than retained comments. This issue is fixed in 0.4.7. | |
| Title | lxml-html-clean: Cleaner(comments=False) keeps a comment that closes <noscript> in the browser, which allows XSS | |
| Weaknesses | CWE-79 | |
| References |
| |
| Metrics |
cvssV3_1
|
Projects
Sign in to view the affected projects.
Status: PUBLISHED
Assigner: GitHub_M
Published:
Updated: 2026-12-02T23:07:46.450Z
Reserved: 2026-12-01T21:46:37.103Z
Link: CVE-2026-141555
No data.
Status : Received
Published: 2026-12-02T21:18:11.160
Modified: 2026-12-03T00:18:06.240
Link: CVE-2026-141555
No data.
OpenCVE Enrichment
No data.
Weaknesses
Github GHSA