CVE-2026-28348: lxml-html-clean CSS @import Filter Bypass via Unicode Escapes

lxml-html-clean Updated 04 Mar 2026

Summary

02/03/2026
Yes i
Moderate
6.1

CVE-2026-28348: lxml-html-clean has CSS @import Filter Bypass via Unicode Escapes. Affects lxml-html-clean versions < 0.4.4. Fixed in 0.4.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

lxml-html-clean is a Python package designed to sanitize HTML content by cleaning up potentially harmful elements, particularly in user-generated content. It focuses on removing unwanted tags and attributes to prevent security vulnerabilities such as XSS (Cross-Site Scripting). However, it is susceptible to a specific vulnerability that allows CSS @import statements to bypass filters, potentially leading to external CSS loading and XSS attacks in older browsers.

Vulnerability Detail

The vulnerability arises from the _has_sneaky_javascript() method in clean.py, which strips backslashes before checking for dangerous CSS keywords. This allows CSS Unicode escape sequences to bypass the @import and expression() filters. For example, a payload like @\69mport is transformed into @69mport, which does not match the blacklist keyword @import. Modern browsers interpret @\69mport as a valid @import statement, leading to the loading of external CSS. This can result in data exfiltration and UI redressing. In older browsers like Internet Explorer, it can lead to full XSS via expression().

How To Fix

Latest published version: 0.4.5 as of 22 Oct 2026

pip install --upgrade "lxml-html-clean==0.4.5"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.4.4

This is the first release that contains the fix.

pip install --upgrade "lxml-html-clean==0.4.4"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using lxml-html-clean for cleaning HTML content that may contain CSS styles until the package is updated. Additionally, you can manually sanitize any CSS styles to prevent the use of @import and expression() statements.

Conclusion

In summary, CVE-2026-28348 is a significant vulnerability in the lxml-html-clean package that allows for CSS @import filter bypass through Unicode escapes. It is crucial to update to the patched version 0.4.4 to mitigate the risks associated with this vulnerability.

See every vulnerability recorded for lxml-html-clean →

Share this vulnerability

FAQ

CVE-2026-28348 is a vulnerability in the lxml-html-clean package that allows CSS @import statements to bypass security filters due to improper handling of Unicode escape sequences.

If your application uses lxml-html-clean to sanitize HTML, it may inadvertently allow external CSS to be loaded, leading to data exfiltration and potential XSS attacks.

Versions of lxml-html-clean up to and including 0.4.3 are affected. The vulnerability is fixed in version 0.4.4.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without needing to sign up.

The CVSS score of this vulnerability is 6.1, indicating a moderate level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for lxml-html-clean.

How To Fix

Latest published version: 0.4.5 as of 22 Oct 2026

pip install --upgrade "lxml-html-clean==0.4.5"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.4.4

This is the first release that contains the fix.

pip install --upgrade "lxml-html-clean==0.4.4"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback