CVE-2018-5158 in the critical feed json
Malicious PDF can inject JavaScript into PDF Viewer
published 2018-06-11 8 y ago modified 2026-06-17 4 mo ago also EUVD-2022-3023 , GHSA-7jg2-jgv3-fmr4
- cvss
- 8.8
- version 3.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 10.3%
- EPSS 10.3% chance of exploitation in 30 days, percentile 95%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- npm pdfjs-dist 1.10.100, 2.0.550
- Mozilla Firefox ESR 52.8
- Mozilla Firefox 60
- firefox-esr Debian 14, Debian 13, Debian 12 52.8.0esr-1
debian advisories DEBIAN-CVE-2018-5158
- firefox Ubuntu 14.04 LTS 60.0+build2-0ubuntu0.14.04.1
- firefox Ubuntu 16.04 LTS 60.0+build2-0ubuntu0.16.04.1
- firefox Ubuntu 18.04 LTS 60.0+build2-0ubuntu1
ubuntu advisories UBUNTU-CVE-2018-5158
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- firefox RHEL 6 52.8.0-1.el6_9
- firefox RHEL 7 52.8.0-1.el7_5
red hat advisories RHSA-2018:1414RHSA-2018:1415
- MozillaFirefox SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +17 more 68.2.0-109.95.2
- MozillaFirefox SLES 12 SP3, SLES 12 SP2-BCL, SLED 12 SP3 +9 more 52.8.0esr-109.31.2
- MozillaFirefox SLE Module for Desktop Applications 15 52.9.0esr-3.7.12
- MozillaFirefox SLES for SAP 11 SP4, SLES 11 SP4, SLES 11 SP3-TERADATA +3 more 52.8.0esr-72.32.1
suse advisories SUSE-SU-2019:2872-1SUSE-SU-2018:1334-2SUSE-SU-2018:2298-1SUSE-SU-2018:1334-1SUSE-SU-2018:1319-1
- firefox-esr openSUSE Tumbleweed 128.5.1-1.1
- MozillaFirefox openSUSE Tumbleweed 92.0-1.2
opensuse advisories openSUSE-SU-2024:14572-1openSUSE-SU-2024:10600-1
- firefox Arch Linux 60.0-1
arch linux advisories AVG-693
- github.com/mozilla/pdf.js@2dc4af5 commit
- github.com/mozilla/pdf.js#9659 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2018-5158 updated cvss 8.8
Mozilla: Malicious PDF can inject JavaScript into PDF Viewer
-
Red Hat Enterprise Linux Client (v. 7) firefox 52.8.0-1.el7_5 Red Hat Enterprise Linux Client Optional (v. 7) firefox 52.8.0-1.el7_5fixed: vendor fix RHSA-2018:1415
-
Red Hat Enterprise Linux Desktop (v. 6) firefox 52.8.0-1.el6_9 Red Hat Enterprise Linux Desktop Optional (v. 6) firefox 52.8.0-1.el6_9fixed: vendor fix RHSA-2018:1414
-
Red Hat Enterprise Linux for ARM and IBM Power LE (POWER9) Server (v. 7) firefox 52.8.0-1.el7_5 Red Hat Enterprise Linux for ARM and IBM Power LE (POWER9) Server Optional (v. 7) firefox 52.8.0-1.el7_5fixed: vendor fix RHSA-2018:1415
-
Red Hat Enterprise Linux HPC Node Optional (v. 6) firefox 52.8.0-1.el6_9 Red Hat Enterprise Linux Server (v. 6) firefox 52.8.0-1.el6_9fixed: vendor fix RHSA-2018:1414
-
Red Hat Enterprise Linux Server (v. 7) firefox 52.8.0-1.el7_5fixed: vendor fix RHSA-2018:1415
-
Red Hat Enterprise Linux Server Optional (v. 6) firefox 52.8.0-1.el6_9fixed: vendor fix RHSA-2018:1414
-
Red Hat Enterprise Linux Server Optional (v. 7) firefox 52.8.0-1.el7_5fixed: vendor fix RHSA-2018:1415
-
Red Hat Enterprise Linux Workstation (v. 6) firefox 52.8.0-1.el6_9fixed: vendor fix RHSA-2018:1414
show 4 moreshow fewer
-
Red Hat Enterprise Linux Workstation (v. 7) firefox 52.8.0-1.el7_5fixed: vendor fix RHSA-2018:1415
-
Red Hat Enterprise Linux Workstation Optional (v. 6) firefox 52.8.0-1.el6_9fixed: vendor fix RHSA-2018:1414
-
Red Hat Enterprise Linux Workstation Optional (v. 7) firefox 52.8.0-1.el7_5fixed: vendor fix RHSA-2018:1415
-
Red Hat Enterprise Linux 6 thunderbird Red Hat Enterprise Linux 7 thunderbird Red Hat Enterprise Linux 8 firefoxnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
10.29% chance of exploitation in the next 30 days, higher than 95% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.0 | 8.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 3.0 | 8.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.8 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | pdfjs-dist | >=2.0.0, <2.0.550 <1.10.100 |
2.0.550 1.10.100 |
Affected products
- Mozilla Firefox ESR
- Mozilla Firefox
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/mozilla/pdf.js/pull/9659
web
-
github.com
/mozilla/pdf.js/commit/2dc4af525d1612c98afcd1e6bee57d4788f78f97
web
-
access.redhat.com
/errata/RHSA-2018:1415
vendor-advisory, web, third-party-advisory
-
security.gentoo.org
/glsa/201810-01
vendor-advisory, web, third-party-advisory
-
access.redhat.com
/errata/RHSA-2018:1414
vendor-advisory, web, third-party-advisory
-
debian.org
/security/2018/dsa-4199
vendor-advisory, web, third-party-advisory
-
usn.ubuntu.com
/3645-1/
vendor-advisory, third-party-advisory
-
mozilla.org
/security/advisories/mfsa2018-11/
vendor-advisory
-
bugzilla.mozilla.org
/show_bug.cgi?id=1452075
web, issue-tracking, vendor-advisory
-
mozilla.org
/security/advisories/mfsa2018-12/
vendor-advisory
-
securitytracker.com
/id/1040896
vdb-entry, web, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2018/05/msg00007.html
mailing-list, web, third-party-advisory
-
securityfocus.com
/bid/104136
vdb-entry, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2018-5158
advisory
-
github.com
/mozilla/pdf.js
package
-
usn.ubuntu.com
/3645-1
web
-
mozilla.org
/security/advisories/mfsa2018-11
web
-
mozilla.org
/security/advisories/mfsa2018-12
web
Sources
- CVE List CVE-2018-5158
- GitHub Advisory GHSA-7jg2-jgv3-fmr4
- NVD CVE-2018-5158
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Add affected node for pdfjs-dist npm package.