CVE-2018-5158 Malicious PDF can inject JavaScript into PDF Viewer
Attackers can execute arbitrary JavaScript with PDF viewer permissions via crafted PDFs due to insufficient sanitization of PostScript functions.
- 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-5158?
CVE-2018-5158 is a high-severity code injection vulnerability in Canonical Ubuntu Linux, published on 11 Jun 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
The PDF viewer does not sufficiently sanitize PostScript calculator functions, allowing malicious JavaScript to be injected through a crafted PDF file. This JavaScript can then be run with the permissions of the PDF viewer by its worker. This vulnerability affects Firefox ESR < 52.8 and Firefox < 60.
Weakness: CWE-94
Which versions are affected by CVE-2018-5158?
4 open source packages ship an affected version, including pdfjs-dist. It affects 9 products.
| Package | Affected | Fixed in |
|---|---|---|
pdfjs-dist npm | All versions | 1.10.100 |
pdfjs-dist npm | All versions | 1.10.100 |
pdfjs-dist npm | From 2.0.0 | 2.0.550 |
pdfjs-dist npm | From 2.0.0 | 2.0.550 |
Products include Canonical Ubuntu Linux, Debian Debian Linux, Mozilla Firefox, Redhat Enterprise Linux Desktop, Redhat Enterprise Linux Server, Redhat Enterprise Linux Server Aus and 3 more.
How do I fix CVE-2018-5158?
Upgrade pdfjs-dist to a fixed version for your release line: 1.10.100 or 2.0.550.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2018-5158 being exploited?
There is no known exploitation of CVE-2018-5158 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Canonical Ubuntu Linux
Sources
Also known as DEBIAN-CVE-2018-5158, GHSA-7jg2-jgv3-fmr4, UBUNTU-CVE-2018-5158.