Exploited now
Vulnerability WatchVulnerabilities, exploits & advisories — updated every 15 minutes
Alerts

Home › Vulnerabilities › fedora-python

Medium 4.7 2 CVEs Analysis

lxml-html-clean Flaws Let Crafted HTML Run Script in Some Cleaner Configurations; Fix Is 0.4.7

NVD published two medium-severity (CVSS 4.7) flaws in the lxml-html-clean Python library, both involving HTML that the Cleaner fails to sanitize in specific non-default settings. Both records say the problems are fixed in version 0.4.7.

What to look into

  • 2 vulnerabilities in fedora-python lxml html clean: 2 medium (CVSS up to 4.7).
  • None of them is known to be exploited yet.
  • Start with CVE-2026-141556 (4.7 medium): 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, w… An attacker without an account can exploit this over the network if a user is tricked into an action, but only under specific conditions.
  • 2 of 2 can be attacked over the network without logging in.
  • Kinds of flaws: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (×2); Incomplete List of Disallowed Inputs.
BrowsersJavaScriptLinuxOperating systemsPythonVulnerabilitiesWeb

Key points

  • Two medium-severity (CVSS 4.7) flaws in the lxml-html-clean Python library, both fixed in 0.4.7.
  • CVE-2026-141556 affects link rewriting with safeattrsonly=False and removeunknowntags=False, via iframe srcdoc and SVG animation attributes.
  • CVE-2026-141555 affects retained comments inside noscript when comments=False, due to parser and browser differences.
  • The default Cleaner settings are described in the records as not exhibiting the comment problem.
  • The records do not give a workaround or state known exploitation.

Two medium-severity flaws (each CVSS 4.7) in lxml-html-clean, an HTML cleaning library for Python, were published by NVD on 2026-12-02. Both concern the Cleaner in lxmlhtmlclean/clean.py failing to remove content that can run script, and both are fixed in version 0.4.7.

What the flaws are

The first, CVE-2026-141556, involves link handling. The rewritelinks step checks only attributes listed in lxml.html.defs.linkattrs, so iframe srcdoc attributes and SVG animation elements are missed. According to the record, when an iframe is kept through hostwhitelist, srcdoc takes priority over its source, and attacker-controlled HTML can run without a click. The record also says SVG set or animate elements can change a link destination to a JavaScript URL that runs when clicked. These paths are described for configurations with safeattrsonly=False and removeunknowntags=False.

The second, CVE-2026-141555, involves comments. With comments=False, conditional comments are removed, but other comments inside noscript are kept. The record states that libxml2 parses that content as markup, while a browser with scripting enabled treats it as raw text. A closing noscript tag inside a retained comment can therefore end the element early, so markup that follows can execute when the cleaned HTML is rendered. The default Cleaner removes all comments, and the record says the same comment outside noscript stays inert.

Who is affected and what to do

The records tie both issues to non-default Cleaner settings. Administrators who depend on the library should check whether their code uses these options. The records name 0.4.7 as the fixed version for both flaws. They do not describe a workaround, and they do not say whether either issue has been exploited.

What to do

  1. Upgrade lxml-html-clean to version 0.4.7 or later, the fixed version named in both records.
  2. Review whether Cleaner is configured with safeattrsonly=False, removeunknowntags=False, hostwhitelist, or comments=False, since the records tie the flaws to these settings.

Our article about all 2 vulnerabilities, written with AI assistance from the official records listed below. Each CVE's page has its details.

The 2 vulnerabilities

  • CVE-2026-141556 4.7 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…
  • CVE-2026-141555 4.7 lxml-html-clean is an HTML cleaning library for Python. Prior to 0.4.7, Cleaner in lxmlhtmlclean/clean.py configured with comments=False uses killconditionalcomments to remove conditional comments but retains other comments inside noscript…

Frequently asked questions

How many fedora-python lxml html clean vulnerabilities were published on December 2, 2026?

2 vulnerabilities: 2 medium, with CVSS scores up to 4.7.

Are any of them being exploited?

None of them is in CISA's Known Exploited Vulnerabilities catalog yet.

Which one should be fixed first?

CVE-2026-141556 (CVSS 4.7): 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, w…

Original records