CVE-2018-5158
Malicious PDF can inject JavaScript into PDF Viewer
Reported by mozilla · Published June 11, 2018
pdfjs-dist is fixed in 2.0.550 and 1.10.100 (npm)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| pdfjs-dist | npm | 2.0.550, 1.10.100 |
| firefox | Arch Linux | 60.0-1 |
| firefox | mozilla | 60.0, 60, 52.8.0 |
| firefox | Ubuntu:18.04:LTS | 60.0+build2-0ubuntu1 |
| firefox | Ubuntu:16.04:LTS | 60.0+build2-0ubuntu0.16.04.1 |
| Firefox ESR | Mozilla | 52.8 |
| firefox | Ubuntu:14.04:LTS | 60.0+build2-0ubuntu0.14.04.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Mozilla | Firefox ESR | unspecified |
| Mozilla | Firefox | unspecified |
| Mozilla | Firefox | * |
| npm | pdfjs-dist | 0 |
| Mozilla | Firefox ESR | * |
| arch | firefox | 0 |
Timeline
- Jun 11, 2018 CVE Published
- May 23, 2020 PoC Published
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Mar 6, 2026 Distribution Patch (4 in total, the first dated here)
- Mar 6, 2026 Security Advisory (7 in total, the first dated here)
- Sep 20, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2018-5158
vulnetix vdb fixes CVE-2018-5158
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2018-5158/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- RHSA-2018:1415 vendor-advisoryx_refsource_REDHAT
- GLSA-201810-01 vendor-advisoryx_refsource_GENTOO
- RHSA-2018:1414 vendor-advisoryx_refsource_REDHAT
- x_refsource_CONFIRM
- 1040896 vdb-entryx_refsource_SECTRACK
- DSA-4199 vendor-advisoryx_refsource_DEBIAN
- USN-3645-1 vendor-advisoryx_refsource_UBUNTU
- [debian-lts-announce] 20180511 [SECURITY] [DLA 1376-1] firefox-esr security update mailing-listx_refsource_MLIST
- x_refsource_CONFIRM
- x_refsource_CONFIRM
- 104136 vdb-entryx_refsource_BID
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-5158 advisory