CVE-2018-5158: Code Injection

Published May 9, 2018
·
Updated

Last updated 24 July 2024

Other sources

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.

— Mozilla

Affected Software

27 affected componentsFixes available
npm/pdfjs-dist<1.10.100
1.10.100
npm/pdfjs-dist>=2.0.0<2.0.550
2.0.550
debian/firefox
131.0.2-2
debian/firefox-esr
115.14.0esr-1~deb11u1128.3.1esr-1~deb11u1115.14.0esr-1~deb12u1128.3.1esr-1~deb12u1128.3.0esr-2128.3.1esr-2
debian/gitlab
16.8.4-1
Mozilla Firefox<60
60
Mozilla Firefox ESR<52.8
52.8
Debian Debian Linux=7.0
Debian Debian Linux=8.0
Debian Debian Linux=9.0
redhat Enterprise Linux Desktop=6.0
redhat Enterprise Linux Desktop=7.0
redhat Enterprise Linux Server=6.0
redhat Enterprise Linux Server=7.0
redhat Enterprise Linux Server Aus=7.6
redhat Enterprise Linux Server Eus=7.5
redhat Enterprise Linux Server Eus=7.6
redhat Enterprise Linux Server Tus=7.6
redhat Enterprise Linux Workstation=6.0
redhat Enterprise Linux Workstation=7.0
Mozilla Firefox<60.0
Mozilla Firefox ESR<52.8.0
Canonical Ubuntu Linux=14.04
Canonical Ubuntu Linux=16.04
Canonical Ubuntu Linux=17.10
Canonical Ubuntu Linux=18.04
Mozilla Firefox<52.8.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/pdfjs-dist to a version that resolves this vulnerability.

    Fixed in 1.10.100
  2. Upgrade

    Upgrade npm/pdfjs-dist to a version that resolves this vulnerability.

    Fixed in 2.0.550
  3. Upgrade

    Upgrade debian/firefox to a version that resolves this vulnerability.

    Fixed in 131.0.2-2
  4. Upgrade

    Upgrade debian/firefox-esr to a version that resolves this vulnerability.

    Fixed in 115.14.0esr-1~deb11u1Fixed in 128.3.1esr-1~deb11u1Fixed in 115.14.0esr-1~deb12u1Fixed in 128.3.1esr-1~deb12u1Fixed in 128.3.0esr-2Fixed in 128.3.1esr-2
  5. Upgrade

    Upgrade debian/gitlab to a version that resolves this vulnerability.

    Fixed in 16.8.4-1
  6. Upgrade

    Upgrade Firefox to a version that resolves this vulnerability.

    Fixed in 60
  7. Upgrade

    Upgrade Firefox ESR to a version that resolves this vulnerability.

    Fixed in 52.8
  8. Upgrade

    Upgrade PDF.js to a version that resolves this vulnerability.

    Fixed in 2.0.550

Event History

May 9, 2018
CVE Published
12:00 AM
Data Sourced
12:00 AM
DescriptionSeverityAffected Software
Updated
12:00 AM
Affected Software
May 10, 2018
Data Sourced
12:00 AM
Remedy
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
Updated
via Ubuntu·12:00 AM
DescriptionAffected Software
Jun 11, 2018
CVE Published
via MITRE·09:00 PM
Data Sourced
via MITRE·09:00 PM
DescriptionWeakness
Mar 13, 2019
Data Sourced
01:44 PM
Weakness
Data Sourced
via NVD·01:44 PM
DescriptionSeverityWeaknessAffected Software
Updated
via NVD·01:44 PM
Affected Software
Feb 26, 2021
Data Sourced
via Red Hat·02:30 AM
DescriptionSeverityAffected Software
May 14, 2022
Advisory Published
via GitHub·01:22 AM
Data Sourced
via GitHub·01:22 AM
DescriptionSeverityWeaknessAffected Software
May 28, 2024
Advisory Published
via GitHub·08:43 PM
Jun 17, 2026
Updated
via NVD·01:59 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2018-5158?

CVE-2018-5158 is a vulnerability in the PDF viewer of Firefox ESR < 52.8 and Firefox < 60 that allows malicious JavaScript to be injected through a crafted PDF file.

2

How does CVE-2018-5158 affect Firefox?

CVE-2018-5158 affects Firefox ESR < 52.8 and Firefox < 60, allowing malicious JavaScript to be injected through a crafted PDF file.

3

What is the severity of CVE-2018-5158?

CVE-2018-5158 has a severity value of 8.8, which is considered high.

4

How can I fix CVE-2018-5158?

To fix CVE-2018-5158, you should update your Firefox browser to version 52.8 or higher.

5

Where can I find more information about CVE-2018-5158?

You can find more information about CVE-2018-5158 at the following references: [Link 1](https://bugzilla.mozilla.org/show_bug.cgi?id=1452075), [Link 2](https://www.mozilla.org/security/advisories/mfsa2018-11/), [Link 3](https://www.mozilla.org/security/advisories/mfsa2018-12/)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203