HighGHSA-7jg2-jgv3-fmr4CVE-2018-5158

Malicious PDF can inject JavaScript into PDF Viewer

Published 14 May 2022 · Updated 28 May 2024

Affected packages

Affected
>=2.0.0 <2.0.550
Fixed in
2.0.550
Update to the fixed version for your release line, for example:npm install pdfjs-dist@2.0.550
Affected
<1.10.100
Fixed in
1.10.100
Update to the fixed version for your release line, for example:npm install pdfjs-dist@1.10.100

Details

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, Firefox < 60 and PDF.js < 2.0.550.

Is GHSA-7jg2-jgv3-fmr4 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected pdfjs-dist, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.