CVE-2026-141556: lxml-html-clean: Cleaner(safe_attrs_only=False) keeps javascript: in iframe srcdoc and SVG animation values

Published Dec 2, 2026
·
Updated

lxml-html-clean is an HTML cleaning library for Python. In versions through 0.4.6, Cleaner in lxmlhtmlclean/clean.py configured with safeattrsonly=False removes JavaScript links using rewritelinks, which visits only attributes in lxml.html.defs.linkattrs and misses iframe srcdoc and SVG animation attributes. When an iframe is retained through hostwhitelist, srcdoc takes priority over its source and can cause attacker-controlled HTML to run without a click. With removeunknowntags=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.

Affected Software

1 affected component
pypi/lxml-html-clean<=0.4.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.4.7

Event History

Dec 2, 2026
CVE Published
via MITRE·08:15 PM
Data Sourced
via MITRE·08:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:18 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to the iframe-based attack path?

Deployments using Cleaner with safe_attrs_only=False and retaining iframes through host_whitelist are exposed. An attacker must be able to supply HTML that is processed by the cleaner; the iframe srcdoc content can then run without a click.

2

When is the SVG animation attack path relevant?

It is relevant when Cleaner uses safe_attrs_only=False and remove_unknown_tags=False. Attacker-controlled SVG set or animate elements can modify a link destination to a JavaScript URL, which executes when the link is clicked.

3

What version fixes the issue?

Upgrade lxml-html-clean to version 0.4.7. Versions through 0.4.6 are affected.

4

What configuration changes can reduce exposure before upgrading?

Avoid using safe_attrs_only=False. Also avoid retaining iframes through host_whitelist and avoid remove_unknown_tags=False where possible, since those settings enable the described iframe and SVG attack paths.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203