Skip to main content
CVE-2026-141556VulnerabilityPublished

lxml_html_clean: Cleaner(safe_attrs_only=False) keeps javascript:

Affects lxml-html-cleanSource GCVE Database

0
Compare
Authoritative record:CVE-2026-141556· Medium 4.7

Not known to be exploited · CVSS 4.7 Medium : upgrade to 0.4.7 when convenient.

Data as of 3 Dec 2026, 04:32 UTC

CVSS 3.1 base score
4.7Medium
How severe the flaw is on the 0–10 CVSS scale.

Thin evidence

One scorer or none
CVSS scores by source
CNA (GitHub_M)CVSS 3.14.7
Patch
Available – fixed in 0.4.7
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 2 Dec 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2 Dec 2026.

What to do

Upgrade lxml-html-clean to 0.4.7.

Affected software

ProductAffectedFixed in
PyPIlxml-html-cleanAffected
  • <0.4.7
Fixed in
  • 0.4.7

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available in lxml-html-clean version 0.4.7 that addresses this issue by removing the srcdoc attribute from all elements and deleting the to, from, by, and values attributes on <set> and <animate> SVG elements when attributeName is href or xlink:href. Users should upgrade to version 0.4.7 or later. If upgrading is not immediately possible, avoid using safe_attrs_only=False or host_whitelist settings that allow iframes with srcdoc. The vendor advisory confirms the fix in 0.4.7.

Description

The lxml-html-clean library versions prior to 0.4.7 have a vulnerability in the Cleaner component when used with safe_attrs_only set to false. The Cleaner fails to remove JavaScript URLs in certain attributes such as iframe's srcdoc and SVG animation elements' to, values, from, and by attributes, allowing JavaScript execution. This can lead to stored or reflected cross-site scripting (XSS) when user HTML is cleaned and rendered. The default Cleaner configuration is not affected. A fix is available in version 0.4.7.

References

Community reviews

Loading reviews…