Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseCVE-2026-141555

CVE-2026-141555: 
Python vulnerability analysis and mitigation

Overview

CVE-2026-141555 is a Cross-Site Scripting (XSS) vulnerability in the lxml-html-clean Python HTML cleaning library (package: lxml-html-clean on PyPI). When the Cleaner class is configured with comments=False, it fails to remove certain HTML comments nested inside <noscript> elements that contain a closing </noscript> tag, allowing attacker-controlled markup to execute in a victim's browser. All versions prior to 0.4.7 are affected (tested on 0.1.0, 0.2.0, 0.4.0, 0.4.4, 0.4.5, and 0.4.6). The advisory was published on November 26, 2026, and the fix was released the same day. The CVSS v3.1 base score is 4.7 (Medium) (GitHub Advisory).

Technical details

The root cause is a parser differential between libxml2 and browsers, classified as CWE-79 (Improper Neutralization of Input During Web Page Generation). libxml2 parses the content of <noscript> as markup, treating <!--</noscript><img src=x onerror=...>--> as a single, inert comment node. However, a scripting-enabled browser treats <noscript> content as raw text, so it closes the element at the first literal </noscript> string — even inside a comment — and then parses the following attacker-controlled markup as live HTML. The Cleaner with comments=False only removes IE conditional comments via kill_conditional_comments() and retains all other comments; an existing check for </noscript> in clean.py only covered <style> text, not retained comment nodes. This is the same class of parser differential as GHSA-5jfw-gq64-q45f. The vulnerability requires no authentication and no user click — only that the victim's browser renders the cleaned HTML with scripting enabled (GitHub Advisory, Fix Commit).

Impact

Successful exploitation allows an unauthenticated remote attacker to execute arbitrary JavaScript in the browser of any user who views a page rendering the cleaned HTML output. The impact is limited to low confidentiality and low integrity (e.g., session token theft, page content manipulation, phishing), with no direct availability impact. The scope is changed, meaning the XSS executes in the context of the page hosting the cleaned content rather than the application processing it. Applications that accept untrusted HTML, sanitize it with Cleaner(comments=False), and then render the output to other users are at risk of stored or reflected XSS attacks (GitHub Advisory).

Exploitability

A proof-of-concept (PoC) reproducer is publicly available in the GitHub Security Advisory, consisting of a short Python snippet that demonstrates the bypass locally. The PoC was confirmed to fire an onerror handler in Chromium headless (version 159.0.8154.13), with the browser test showing fired=1 and title=FIRED. The EPSS score is 0.0, and there is no evidence of in-the-wild exploitation at this time. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires high attack complexity (the attacker must control HTML input to the cleaner and the output must be rendered in a scripting-enabled browser), but no authentication or user click is needed (GitHub Advisory).

Exploitation steps

  1. Identify a target application: Find a web application that accepts user-supplied HTML, processes it with lxml_html_clean.Cleaner(comments=False) on a version prior to 0.4.7, and renders the cleaned output to other users.
  2. Craft the malicious payload: Construct an HTML payload embedding a closing </noscript> tag inside a comment within a <noscript> element, followed by an executable element:
    <noscript><!--</noscript><img src=x onerror="alert(document.cookie)">--></noscript>
  3. Submit the payload: Inject the crafted HTML into the application's input field (e.g., a comment box, rich-text editor, or any field that accepts HTML).
  4. Cleaner processes the input: The vulnerable Cleaner(comments=False) retains the comment node because libxml2 treats it as a single inert comment inside <noscript>. The kill_conditional_comments function does not remove it.
  5. Victim renders the cleaned output: When a scripting-enabled browser loads the page containing the cleaned HTML, it treats <noscript> content as raw text, terminates the element at the </noscript> inside the comment, and parses the <img onerror=...> as live markup.
  6. JavaScript executes: The onerror handler fires automatically without any user interaction, achieving XSS in the victim's browser context (GitHub Advisory).

Indicators of compromise

  • Network: HTTP requests containing the pattern <!--</noscript> or <!--</{raw-text-element}> in POST body or URL parameters submitted to HTML-accepting endpoints.
  • Logs: Application logs showing user-submitted content containing <noscript> combined with HTML comment syntax (<!--) and closing tags like </noscript>, </iframe>, </textarea>, etc.
  • File System: If the application stores user-submitted HTML, search stored content for the pattern <noscript><!-- combined with onerror, onload, or other JavaScript event handlers.
  • Process/Application: Unexpected JavaScript execution reports from browser-side monitoring (e.g., CSP violation reports) triggered by onerror or similar event handlers on elements like <img src=x>.

Mitigation and workarounds

Upgrade lxml-html-clean to version 0.4.7 or later, which drops comments that contain an end tag that would close a raw-text ancestor element (noscript, noembed, noframes, iframe, xmp, title, textarea, style, script, plaintext) (Fix Commit, Release 0.4.7). As an immediate workaround, avoid using Cleaner(comments=False) when processing untrusted HTML — the default Cleaner() (which removes all comments) is not affected. Additionally, apply a strict Content Security Policy (CSP) to pages that render user-supplied HTML to limit the impact of any XSS execution. Audit all code paths that call lxml_html_clean with comments=False and review any cleaned HTML containing <noscript> elements.

Community reactions

The vulnerability was reported privately by researcher gistrec via GitHub's private vulnerability reporting feature, and remediated by maintainer frenzymadness with assistance from Claude Opus 4.8. The advisory notes this is the same class of parser differential as the previously disclosed GHSA-5jfw-gq64-q45f, which had only been addressed for <style> text content. No significant broader media coverage or social media discussion has been identified at this time (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-2vwr-58qv-f67xMEDIUM6.5
  • Python logoPython
  • aiortc
NoYesDec 02, 2026
GHSA-hvx6-xjcv-pww2MEDIUM6.5
  • Python logoPython
  • pika
NoYesDec 02, 2026
CVE-2026-141556MEDIUM4.7
  • Python logoPython
  • lxml-html-clean
NoYesDec 02, 2026
CVE-2026-141555MEDIUM4.7
  • Python logoPython
  • lxml-html-clean
NoYesDec 02, 2026
GHSA-xhqj-2fcc-8vf7LOW3.1
  • Python logoPython
  • ag2
NoYesDec 02, 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