Skip to main content

lxml-html-clean CVE-2026-141556

| EUVDEUVD-2026-141834 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-12-02 GitHub_M GHSA-5gvf-7wqf-r4cv
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 HTML to sanitizing app
  2. Delivery
    Cleaner retains iframe srcdoc or SVG animation value
  3. Exploit
    Victim renders cleaned output
  4. Execution
    javascript: payload executes in browser context
  5. Impact
    Session theft or actions as victim

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 non-default configuration Cleaner(safe_attrs_only=False); the default Cleaner() (safe_attrs_only=True) is not affected because it strips srcdoc, to and values. The clickless iframe srcdoc variant additionally requires host_whitelist to be set so the attacker's <iframe> is retained - srcdoc then overrides the whitelisted src and runs on render with no interaction. The SVG <set>/<animate> variant additionally requires remove_unknown_tags=False and one user click on the resulting SVG link, since the animation sets href to a javascript: URL at runtime. In all cases the application must render the cleaned HTML back to a victim. Limiting factors: both paths depend on operator-chosen non-default Cleaner options, and the SVG path also needs user interaction, so default-configured users are not exposed.

Impact

This is a genuine but moderate-priority issue, not a drop-everything emergency, and the signals are internally consistent. The CVSS 3.1 base score is 4.7 (Medium) with vector AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N: network-reachable and unauthenticated (attacker-supplied HTML), but with high attack complexity and required user interaction, a changed scope (script escapes the sanitizer boundary into the victim's browser), and only Low confidentiality/integrity impact with no availability impact. The vuln.today decision label is 'this_month' - a prioritized-but-not-urgent signal, consistent with the absence of a CISA KEV listing. No EPSS score is present in the input, so probabilistic exploitation likelihood cannot be quantified; this is a data gap, not a low score. The vulnerability is NOT in CISA KEV, so there is no confirmed active exploitation. A detailed public PoC reference exists - the GHSA advisory includes reproduction payloads and headless-Chromium verification - but it is not labelled in the input as confirmed weaponized exploit code. The dominant risk-limiting factor is configuration dependency: exploitation requires a non-default Cleaner(safe_attrs_only=False), and the clickless variant additionally requires host_whitelist. The default Cleaner() is explicitly not affected. Net: a real sanitizer-bypass XSS worth patching this month for affected deployments, but its reach is gated by non-default configuration rather than being broadly exploitable.

Exploit ScenarioDerived

An attacker submits HTML into an application that sanitizes user content with Cleaner(safe_attrs_only=False) and then renders the result. If the app also sets host_whitelist (e.g. to permit video embeds), an attacker-supplied <iframe> is retained and its srcdoc attribute - an entire HTML document that takes priority over src - executes script in the victim's browser on page load with no click. A public PoC in the GHSA advisory reproduces this and verifies execution in headless Chromium; a separate SVG <set>/<animate> variant achieves XSS after one click when remove_unknown_tags=False.

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

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

Alert me

AnalysisAIv1 – Dec 02, 2026

HTML sanitization bypass in lxml-html-clean through 0.4.6 allows attacker-supplied script to survive Cleaner when it is configured with the non-default safe_attrs_only=False option, via iframe srcdoc and SVG set/animate attributes that rewrite_links does not visit. The clickless srcdoc path additionally requires host_whitelist so the attacker's iframe is retained; the SVG path requires remove_unknown_tags=False and one click on the resulting link. The default Cleaner() (safe_attrs_only=True) is not affected because it strips srcdoc, to and values; a public proof-of-concept reference is documented in the advisory, but exploit code availability was not independently confirmed and there is no CISA KEV entry.

RemediationAI

Upgrade lxml-html-clean to 0.4.7, the version listed in the vendor advisory and release tag https://github.com/fedora-python/lxml_html_clean/releases/tag/0.4.7; the upstream fix commit is https://github.com/fedora-python/lxml_html_clean/commit/883db209e04222a1959f7773f5bde1da0224fbe1. The fix removes srcdoc from every element and removes to/from/by/values from SVG set/animate/animateTransform elements whose attributeName targets href or xlink:href. As compensating controls where upgrading is not immediately possible, keep the default safe_attrs_only=True, which strips srcdoc, to and values and is not affected; if safe_attrs_only=False is required, avoid setting host_whitelist so attacker iframes are not retained and keep remove_unknown_tags=True so SVG set/animate elements are dropped, since those options are the prerequisites for the two exploit paths described in GHSA-5gvf-7wqf-r4cv.

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

The Cleaner in lxml_html_clean/clean.py removes JavaScript by deleting on* attributes and blanking javascript: URLs through doc.rewrite_links(self._remove_javascript_link). rewrite_links only visits attributes listed in lxml.html.defs.link_attrs, which omits srcdoc on iframe and the SVG animation value attributes to, from, by and values. This is an incomplete-blacklist problem (CWE-184) manifesting as XSS (CWE-79), the same root cause previously reported for xlink:href with safe_attrs_only=False. An iframe srcdoc value is a complete HTML document rendered inside the frame and takes priority over src, so a whitelisted src does not make it safe; with host_whitelist set, the iframe is retained and its srcdoc content runs on render. On SVG set/animate/animateTransform elements, attributeName="href" (or xlink:href) combined with to/from/by/values changes the enclosing link's destination to a javascript: URL at runtime, so the javascript: scheme ends up on the link even though href itself was cleaned. The fix drops srcdoc from every element and drops to/from/by/values on SVG animation elements whose attributeName resolves to href or xlink:href, comparing names case-insensitively and without namespace or prefix so XHTML srcdoc/SRCDOC collisions and namespaced href variants cannot hide.

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

AC:H because exploitation depends on non-default Cleaner options; UI:R as the SVG path needs a click (srcdoc path is clickless); S:C since script escapes the sanitizer into the browser; C:L/I:L, A:N for typical XSS.

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:A/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. In versions through 0.4.6, Cleaner in lxml_html_clean/clean.py configured with safe_attrs_only=False removes JavaScript links using rewrite_links, which visits only attributes in lxml.html.defs.link_attrs and misses iframe srcdoc and SVG animation attributes. When an iframe is retained through host_whitelist, srcdoc takes priority over its source and can cause attacker-controlled HTML to run without a click. With remove_unknown_tags=False, SVG set or animate elements can use attributeName and attributes such as to, from, by, or values to change a link destination to a JavaScript URL that runs when clicked. This vulnerability is fixed in 0.4.7.

Threat Intelligence Overview

EPSS Score
0.4%
Top 65% exploitable
Prevalence
Medium
common Python HTML-sanitization library; real risk gated to non-default configurations
Threat Intel
1
1 sources
Data Quality
5 sources
Confidence: Medium

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 No
EPSS 0.4%
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· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
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