All vulnerabilities

PyPI

CVE-2026-141555

lxml_html_clean: Cleaner(comments=False) keeps a comment that closes <noscript> in the browser, which allows XSS

Severity
Medium 4.7
Published
3 Dec 2026
Last changed
3 Dec 2026
Added to UpHeron
3 Dec 2026
Fixed in
0.4.7
Weakness
Cross-site scripting (CWE-79)
Attack
Over the network · Only under certain conditions · No login needed · Needs someone to click or open something
Attacker can
Read some data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Also known as
GHSA-vfhw-gfwp-vxfj
Sources
OSV.dev and GitHub

Description

With comments=False, the Cleaner removes only IE conditional comments (lxml_html_clean/clean.py:363-366, kill_conditional_comments at 599-607) and keeps every other comment (421-422, 511-513). libxml2 parses the content of as markup, so is a single comment node and is returned unchanged. A browser with scripting enabled treats as raw text, closes it at the first , and parses the rest as live markup. The handler runs when the cleaned output is rendered in a page, with no click.

The default Cleaner() is not affected, because it removes all comments. The same comment outside stays an inert comment in the browser.

This is the parser difference from GHSA-5jfw-gq64-q45f. The text only.

Tested on lxml_html_clean 0.4.6 from PyPI (same commit as main), lxml 6.1.3, libxml2 2.14.6, Python 3.12.16, Chromium 159.0.8154.13 headless, with no network. The output is byte-identical on 0.1.0, 0.2.0, 0.4.0, 0.4.4 (lxml 5.1.0, libxml2 2.12.3) and 0.4.5.

From the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
lxml-html-cleanPyPI · osv:PyPI:lxml-html-clean
  • Every version before 0.4.7

About lxml-html-clean

Weekly downloads (PyPI)
4,712,144PyPI Stats, 3 Dec 2026

Vulnerabilities in lxml-html-clean

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
0
Known exploited
0
Search the list for lxml-html-clean

References