Skip to main content

lxml-html-clean CVE-2026-141555

| EUVDEUVD-2026-141830 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-12-02 GitHub_M GHSA-vfhw-gfwp-vxfj
4.7
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted noscript breakout comment to sanitizing app
  2. Exploit
    Survive Cleaner(comments=False) as inert comment node
  3. Execution
    Victim browser reparses noscript body as live markup
  4. Impact
    Execute attacker JavaScript in victim's session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the consuming application to use Cleaner(comments=False) - the non-default mode that retains comments; the default Cleaner() removes all comments and is not affected. The attacker must supply HTML containing a comment nested inside a raw-text or escapable-raw-text element (noscript, and per the fix also noembed, noframes, iframe, xmp, title, textarea, style, script, plaintext) whose text smuggles a matching end tag (e.g. '<!--</noscript><img src=x onerror=...>-->'), exploiting the libxml2-versus-browser parser differential. Limiting factors: the vulnerable comments=False configuration is not the default; the cleaned output must later be rendered in a browser with scripting enabled (user interaction / UI:R); and impact is confined to client-side script execution in the victim's rendering context (low confidentiality/integrity, no availability impact). No special attacker authentication is needed to submit the payload (PR:N).

Impact

Signals point to a genuine but bounded issue rather than an urgent emergency. The CVSS 3.1 base vector (AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, 4.7 medium) already encodes the limiters: no authentication to supply the payload (PR:N), but high attack complexity (AC:H) and required user interaction (UI:R), with only low confidentiality and integrity impact and a scope change into the rendering browser. No EPSS score was provided and the input shows no CISA KEV listing, so this is not confirmed as actively exploited. A public PoC reference exists - the GHSA advisory includes a byte-level reproduction tested on Chromium 159 headless - so exploitability is well demonstrated even though it is not packaged as a weaponized exploit. The vuln.today decision label is 'this_month', consistent with a moderate, non-emergency priority. The single largest real-world limiter is not in the CVSS vector at all: the flaw only affects the non-default Cleaner(comments=False) configuration; the default Cleaner() strips all comments and was never affected, which materially narrows the exposed population. Net: a real XSS worth patching this cycle, not a high-CVSS-but-illusory issue, but far from an internet-wide emergency given AC:H, UI:R, low impacts, and the non-default-config requirement.

Exploit ScenarioDerived

An application that sanitizes user-submitted HTML with lxml-html-clean's Cleaner(comments=False) accepts attacker content such as '<noscript><!--</noscript><img src=x onerror=...>--></noscript>'. libxml2 preserves this as one inert comment node, so it survives cleaning, but when another user later renders the stored output in a scripting-enabled browser the noscript is closed inside the comment and the img onerror handler fires with no click. A tested public PoC for this behavior is published in the GHSA advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Dec 02, 2026

Comment-preserving HTML sanitization in lxml-html-clean 0.4.6 and earlier lets attacker-supplied markup break out of a raw-text element and execute script when the cleaned output is rendered. The flaw only manifests when an application instantiates Cleaner(comments=False); the default Cleaner() strips all comments and is unaffected. A comment whose text smuggles a matching end tag (for example '<!--</noscript><img src=x onerror=...>-->' nested inside <noscript>) survives libxml2 parsing as an inert node but is reinterpreted by a scripting-enabled browser as the close of the element plus live markup, so the handler fires without a click. Severity is bounded (CVSS 4.7, AC:H/UI:R/S:C/C:L/I:L/A:N, PR:N) and the maintainers' advisory contains a reproduction payload; no confirmed, weaponized exploit code was identified at time of analysis. Patch status: Vendor-released patch: 0.4.7.

RemediationAI

Upgrade lxml-html-clean to 0.4.7 or later (release at https://github.com/fedora-python/lxml_html_clean/releases/tag/0.4.7), which drops any retained comment containing an end tag matching a raw-text ancestor; the upstream commit is https://github.com/fedora-python/lxml_html_clean/commit/c83f0befb32505782858f56a17ac572fbf979f62 and the vendor advisory is https://github.com/fedora-python/lxml_html_clean/security/advisories/GHSA-vfhw-gfwp-vxfj. Where upgrading is not immediately possible, the practical stop-gap is to stop constructing Cleaner(comments=False): use the default Cleaner(), which strips all comments and is unaffected, at the cost of no longer preserving comments or IE conditional comments in the sanitized output. There is no documented way to keep comment retention safe on 0.4.6 short of post-filtering the cleaned tree for comments that contain an end tag matching an ancestor raw-text element (noscript, noembed, noframes, iframe, xmp, title, textarea, style, script, plaintext), which reimplements the upstream fix. Because exploitation also requires the cleaned HTML to be rendered in a scripting-enabled browser, auditing which call sites pass comments=False and how their output reaches the client will identify the exposed paths.

Affected VersionsENISA

lxml_html_clean < 0.4.7

Affected Packages

pypi lxml-html-clean fix: 0.4.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

lxml-html-clean is a Python HTML sanitizer built on lxml, which delegates parsing to libxml2. The root cause is a parser differential (CWE-79, cross-site scripting) between the HTML parsing model of libxml2 and that of browsers. libxml2 parses the content of raw-text elements such as <noscript> as ordinary markup, so a comment containing an end tag like '<!--</noscript><img src=x onerror=...>-->' is captured as a single, seemingly harmless comment node. A browser with scripting enabled instead treats the <noscript> body as raw text, so the literal '</noscript>' inside the comment terminates the element and everything after it is parsed as live markup. In the affected configuration, kill_conditional_comments() in lxml_html_clean/clean.py drops only IE conditional comments and retains other comments; the earlier hardening for GHSA-5jfw-gq64-q45f added a '</noscript' check that was applied to <style> text only, not to retained comment nodes. The 0.4.7 fix generalises the check across raw-text and escapable-raw-text ancestors (noscript, noembed, noframes, iframe, xmp, title, textarea, style, script, plaintext) and drops any retained comment containing an end tag matching such an ancestor, while preserving benign comments. The trigger requires the sanitizer consumer to opt into comment retention and to render the cleaned output in a browser; nothing in the available sources describes a server-side impact.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 4.7 MEDIUM
AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 4.7 MEDIUM

Attacker needs no auth to submit HTML (PR:N) but relies on a parser differential and a non-default comments=False config (AC:H), a victim must render output (UI:R), and stored XSS escapes into the browser (S:C) with low C/I impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

1
Patch available
Dec 02, 2026 - 21:03 EUVD

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.5%
Top 57% exploitable
Prevalence
Medium
common Python HTML-sanitization library, but vulnerable path needs non-default config
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA MSRC GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy