HTML Injection Vulnerability in lxml-html-clean Package

lxml-html-clean Updated 09 Mar 2026

Summary

05/03/2026
N/A
No i
Medium
6.1

DEBIAN-CVE-2026-28350: lxml_html_clean is a project for HTML cleaning functionalities copied from lxml.html.clean. Affects lxml-html-clean versions 0.4.2-1 – 0.4.4-1. No fix is published. 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 Penetration testing for web, API and mobile 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 project designed for HTML cleaning functionalities, derived from the lxml.html.clean module. It is commonly used in web applications to sanitize HTML content, ensuring that only safe and valid HTML is processed. However, prior to version 0.4.4, the package had a significant security flaw that allowed attackers to exploit the <base> tag, potentially compromising the integrity of web pages.

Vulnerability Detail

The vulnerability arises from the default Cleaner configuration in lxml-html-clean, which allows the <base> tag to pass through without specific handling. Although the configuration removes certain tags like html, head, and title when page_structure=True is set, it does not address the <base> tag. This oversight enables attackers to inject malicious <base> tags, which can hijack relative links on the page, leading to phishing attacks or redirecting users to harmful sites.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, you can manually sanitize any <base> tags in your HTML content before processing it with lxml-html-clean. This can be done by removing or validating the <base> tag to ensure it does not contain malicious URLs.

Conclusion

The lxml-html-clean package has a critical vulnerability that allows for HTML injection through the <base> tag. It is crucial to update to version 0.4.4 or later to protect against potential attacks. Implementing temporary workarounds can help mitigate risks until the update is applied.

See every vulnerability recorded for lxml-html-clean →

Share this vulnerability

FAQ

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

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Simply upload your manifest file like package-lock.json to check for vulnerabilities.

If exploited, this vulnerability can lead to phishing attacks, where users are redirected to malicious sites, compromising their sensitive information.

While updating is the best solution, you can implement manual sanitization of HTML content as a temporary measure to mitigate risks.

Detailed information about this vulnerability can be found in the official CVE database and security advisories related to lxml-html-clean.

Related vulnerabilities

Recent vulnerabilities recorded for lxml-html-clean.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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