CVE-2018-19787 Improper Neutralization of Input During Web Page Generation in LXML

Medium 6.1 Published Updated

Attackers can execute arbitrary JavaScript in victim browsers via escaped javascript URLs in HTML cleaned by lxml.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2018-19787?

CVE-2018-19787 is a medium-severity cross-site scripting vulnerability in Canonical Ubuntu Linux, published on 2 Dec 2018. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

An issue was discovered in lxml before 4.2.5. lxml/html/clean.py in the lxml.html.clean module does not remove javascript: URLs that use escaping, allowing a remote attacker to conduct XSS attacks, as demonstrated by "j a v a s c r i p t:" in Internet Explorer. This is a similar issue to CVE-2014-3146.

Weakness: CWE-79

Which versions are affected by CVE-2018-19787?

3 open source packages ship an affected version, including lxml. It affects 3 products.

PackageAffectedFixed in
lxml PyPIAll versions4.2.5
lxml PyPIAll versions4.2.5
lxml PyPIAll versions4.2.5

Products include Canonical Ubuntu Linux, Debian Debian Linux, Lxml Lxml.

How do I fix CVE-2018-19787?

Upgrade lxml to 4.2.5 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2018-19787 being exploited?

There is no known exploitation of CVE-2018-19787 in the wild and no public exploit code.

All Canonical Ubuntu Linux vulnerabilities

Sources

Also known as AZL-6806, DEBIAN-CVE-2018-19787, GHSA-xp26-p53h-6h2p, MGASA-2018-0497, PYSEC-2018-12, UBUNTU-CVE-2018-19787 and 2 more.

Is CVE-2018-19787 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free