Home/Research/Post

GHSA-vfhw-gfwp-vxfj: lxml_html_clean: Cleaner(comments=False) keeps a comment that closes in the browser, which allows XSS

  • Severity: MEDIUM
  • CVE: CVE-2026-141555
  • Ecosystems: pip
  • Packages: lxml-html-clean

## Summary

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 `

Source: GitHub Security Advisories · 2026-12-03