CVE-2014-3146: Lxml Cross-Site Scripting Vulnerability
MODERATECVE-2014-3146 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Lxml libraries in the PyPI ecosystem. The issue involves lxml cross-site scripting via control characters. Remediation is available by upgrading affected packages to version 3.3.5.
CVE-2014-3146 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2014-3146
To remediate this vulnerability, upgrade all affected Lxml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install lxml>=3.3.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show lxml
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2014-3146, inspect your installed packages using pip:
pip show lxml
Analyze the terminal output to locate any version of Lxml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.5), your application is affected.
Note: The pip show lxml command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Lxml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2014-3146 Affected Lxml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
lxml
|
PyPI |
< 3.3.5
|
3.3.5
|
References
Frequently Asked Questions
What is CVE-2014-3146?
Which Lxml versions are affected?
What version fixes CVE-2014-3146?
Is lxml affected?
What is the CVSS score of CVE-2014-3146?
What CWE is associated with CVE-2014-3146?
How can I check PyPI dependencies for CVE-2014-3146?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-57qw-cc2g-pv5p",
"modified" : "2024-09-30T17:03:32Z",
"published" : "2022-05-14T04:01:59Z",
"aliases" : [ "CVE-2014-3146" ],
"summary" : "lxml Cross-site Scripting Via Control Characters",
"details" : "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` function.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "lxml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.3.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2014-3146"
}, {
"type" : "WEB",
"url" : "https://github.com/lxml/lxml/pull/273"
}, {
"type" : "WEB",
"url" : "https://github.com/lxml/lxml/commit/3f3082e0a67851cde26a48da3d1f4b75d8aa07ec"
}, {
"type" : "WEB",
"url" : "https://github.com/lxml/lxml/commit/86e81ab393ba14c1be71284675851a3bdce57d69"
}, {
"type" : "WEB",
"url" : "https://github.com/lxml/lxml/commit/e86b294f1f81b899a59925123560ff924a72f1cc"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/lxml/lxml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/lxml/PYSEC-2014-9.yaml"
}, {
"type" : "WEB",
"url" : "https://mailman-mail5.webfaction.com/pipermail/lxml/2014-April/007128.html"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20140724172044/http://secunia.com/advisories/58013"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20140805110535/http://secunia.com/advisories/59008"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20140806061046/http://secunia.com/advisories/58744"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20141017122607/https://mailman-mail5.webfaction.com/pipermail/lxml/2014-April/007128.html"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20150523055039/http://www.mandriva.com/en/support/security/advisories/advisory/MDVSA-2015:112/?name=MDVSA-2015:112"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20200228180542/http://www.securityfocus.com/bid/67159"
}, {
"type" : "WEB",
"url" : "http://advisories.mageia.org/MGASA-2014-0218.html"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-updates/2014-05/msg00083.html"
}, {
"type" : "WEB",
"url" : "http://lxml.de/3.3/changes-3.3.5.html"
}, {
"type" : "WEB",
"url" : "http://seclists.org/fulldisclosure/2014/Apr/210"
}, {
"type" : "WEB",
"url" : "http://seclists.org/fulldisclosure/2014/Apr/319"
}, {
"type" : "WEB",
"url" : "http://www.debian.org/security/2014/dsa-2941"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2014/05/09/7"
}, {
"type" : "WEB",
"url" : "http://www.ubuntu.com/usn/USN-2217-1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-04T20:12:48Z",
"nvd_published_at" : "2014-05-14T19:55:00Z"
}
}