PDF.js vulnerabilitiesPDF.js: known vulnerabilities and safe versions
npm: pdfjs-dist
PDF.js has 5 known vulnerability records: 4 in the npm advisory data (GitHub Advisory Database via OSV, the same source npm audit uses) and 1 only in Retire.js (CDN builds and advisories without a CVE).
By branch: 6.x is safe from 6.2.108; 5.x has no fixed release in the records; 4.x is safe from 4.2.67; 2.x has no fixed release in the records.
Vulnerabilities and safe version by branch
Safe version: on that branch, this release and every later one (up to the branch's latest release, where known) fall outside every known record's range. Candidates are only the records' own fixed versions and the branch's latest release; "No fix" means moving off the branch.
| Branch | Support | Latest on branch | Records | Safe version |
|---|---|---|---|---|
| 6.x | — | — | 2high | 6.2.108 |
| 5.x | — | — | 2high | No fix |
| 4.x | — | — | 2high | 4.2.67 |
| 2.x | — | — | 3high | No fix |
| 1.x | — | — | 3high | No fix |
Support dates appear only for libraries that endoflife.date tracks.
Records
Newest first. Ranges are the record's own data; several ranges mean separate fixes per branch.
GHSA-hq66-cqwq-w95j2026-08-06
PDF.js: Arbitrary JavaScript execution upon opening a malicious PDF
Affected versions: >= 5.6.83, < 6.2.108
high
Fixed in: 6.2.108
CVE-2024-4367exploit code exists2024-05-14
A type check was missing when handling fonts in PDF.js, which would allow arbitrary JavaScript execution in the PDF.js context.
Affected versions: < 4.2.67
high 8.8
Fixed in: 4.2.67
EPSS 70.6%
CVE-2024-343422024-05-07
react-pdf's PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF
Affected versions: < 4.2.67
high 7.1
Fixed in: 4.2.67
EPSS 1%
CVE-2018-5158exploit code exists2018-06-11
The PDF viewer does not sufficiently sanitize PostScript calculator functions, allowing malicious JavaScript to be injected through a crafte
Affected versions: >= 2.0.0, < 2.0.550 · < 1.10.100
high 8.8
Fixed in: 1.10.100, 2.0.550
EPSS 10.2%
PDF.js: Arbitrary JavaScript execution upon opening a malicious PDF
Affected versions: >= 5.6.83, < 6.2.108
high
Fixed in: 6.2.108
Sources and method
Ranges: GitHub Advisory Database (OSV npm export, daily) and Retire.js (Apache-2.0). Exploitation: CISA KEV, FIRST EPSS and exploit maturity from the Noroxi CVE database. Support dates: endoflife.date.
This page and the JavaScript library scan use the same matching rule: a row without bounds is not evidence, and versions are compared in one place. A record without a version range never counts as "affected" in the version check.
Data as of October 26, 2026.