Improper Encoding or Escaping of Output Affecting lxml-html-clean package, versions [,0.4.4)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.25% (17th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-LXMLHTMLCLEAN-15369131
  • published3 Mar 2026
  • disclosed2 Mar 2026
  • credituug4na

Introduced: 2 Mar 2026

CVE-2026-28350  (opens in a new tab)
CWE-116  (opens in a new tab)

How to fix?

Upgrade lxml-html-clean to version 0.4.4 or higher.

Overview

lxml-html-clean is a HTML cleaner from lxml project

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output in the default Cleaner configuration due to the incomplete page_structure kill set that does not account for <base> tags outside <head> tags. An attacker can hijack the resolution of all relative URLs, redirect user navigation and form submissions, steal credentials or sensitive data, execute malicious scripts, or alter the appearance of the page by injecting a <base> tag and controlling the base URL for links, scripts, images, and stylesheets.

PoC

from lxml_html_clean import clean_html

# The base tag is preserved in the output
result = clean_html('<base href="http://evil.com/"><a href="/account">Account</a>')
print(result)
# Output: <div><base href="http://evil.com/">...<a href="/account">Account</a></div>

References

CVSS Base Scores

version 4.0
version 3.1