Cross-Site Scripting Vulnerability in lxml Package: CVE-2014-3146

lxml Updated 02 Oct 2025

Summary

14/05/2014
N/A
Yes i
Unrated
Not published

CVE-2014-3146: Incomplete blacklist vulnerability in the lxml.html.clean module in lxml before 3.3.5 allows remote attackers to conduct cross-site scripting (XSS) attacks via control characters in the link scheme to the clean_html func... Affects lxml versions < 3.3.5-1. Fixed in 3.3.5-1. 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 is a powerful and feature-rich library in Python used for processing XML and HTML documents. It provides a convenient API for parsing, creating, and manipulating XML and HTML, making it a popular choice among developers. However, prior to version 3.3.5, lxml's html.clean module contained an incomplete blacklist vulnerability that could be exploited for cross-site scripting (XSS) attacks.

Vulnerability Detail

The vulnerability, identified as CVE-2014-3146, stems from an incomplete blacklist in the lxml.html.clean module, which allows remote attackers to conduct XSS attacks. This occurs when control characters are included in the link scheme passed to the clean_html function. If exploited, this vulnerability can lead to unauthorized script execution in the context of the user's browser, potentially compromising sensitive information or user sessions.

How To Fix

Minimum fixed version

3.3.5-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade lxml

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

Workaround

If upgrading is not immediately feasible, consider implementing input validation and sanitization on any user-generated content that will be processed by the lxml library. This can help mitigate the risk of XSS attacks until the package can be updated.

Conclusion

CVE-2014-3146 is a critical vulnerability in the lxml package that can lead to serious security risks through XSS attacks. Users are strongly advised to upgrade to version 3.3.5 or later to mitigate these risks. For those unable to upgrade immediately, implementing input validation can serve as a temporary measure.

See every vulnerability recorded for lxml →

Share this vulnerability

FAQ

CVE-2014-3146 is a vulnerability in the lxml package that allows remote attackers to perform cross-site scripting (XSS) attacks via control characters in the link scheme.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If exploited, this vulnerability can allow attackers to execute arbitrary scripts in the context of the user's browser, leading to data theft or session hijacking.

Yes, upgrading to lxml version 3.3.5 or later resolves this vulnerability.

Implement input validation and sanitization on user-generated content to reduce the risk of XSS attacks until you can upgrade.

Related vulnerabilities

Recent vulnerabilities recorded for lxml.

How To Fix

Minimum fixed version

3.3.5-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade lxml

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