CVE-2026-28350: lxml-html-clean Package Vulnerability - <base> Tag Injection Risk

lxml-html-clean Updated 04 Mar 2026

Summary

02/03/2026
Yes i
Moderate
6.1

CVE-2026-28350: lxml-html-clean has tag injection through default Cleaner configuration. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

lxml-html-clean is a Python package designed for cleaning and sanitizing HTML content. It provides a Cleaner class that allows developers to specify which HTML tags and attributes should be removed or preserved. However, a significant vulnerability exists in the default configuration of the Cleaner, which fails to handle the <base> tag appropriately, potentially allowing attackers to manipulate relative URLs on a webpage.

Vulnerability Detail

The vulnerability arises from the default Cleaner configuration in lxml-html-clean, which does not include the <base> tag in its page_structure kill set. This oversight allows an attacker to inject a <base> tag into the HTML output, thereby altering the base URL for all relative links on the page. As a result, attackers can redirect user navigation, execute phishing attacks, and exploit Cross-Site Scripting (XSS) vulnerabilities by loading malicious scripts from their own domain. The impact of this vulnerability is significant, as it can lead to credential theft, data exposure, and UI defacement.

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, developers can manually sanitize input to ensure that <base> tags are not included in the HTML content before passing it to the Cleaner. Here is an example of how to do this:

import re
from lxml_html_clean import clean_html

# Function to remove <base> tags
def remove_base_tags(html_content):
    return re.sub(r'<base[^>]*>', '', html_content)

# Clean HTML after removing <base> tags
html_content = '<base href="http://evil.com/"><a href="/account">Account</a>'
cleaned_html = clean_html(remove_base_tags(html_content))
print(cleaned_html)

Conclusion

The lxml-html-clean package has a vulnerability that allows for <base> tag injection, posing risks such as phishing, XSS, and UI manipulation. It is crucial to update to the patched version or implement workarounds to mitigate these risks.

See every vulnerability recorded for lxml-html-clean →

Share this vulnerability

FAQ

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

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The potential attack vectors include phishing and redirection, Cross-Site Scripting (XSS), and UI defacement.

Yes, the vulnerability has been patched in version 0.4.4 of the lxml-html-clean package.

If immediate updates are not possible, implement a workaround by sanitizing the HTML input to remove any <base> tags before processing.

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