Skip to content

PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF

High
nxglabs published GHSA-7fj5-f2j3-5m7x Aug 1, 2024

Package

npm pdfjs-dist (npm)

Affected versions

<= 4.1.392

Patched versions

4.2.67

Description

Impact

If pdf.js is used to load a malicious PDF, and PDF.js is configured with isEvalSupported set to true (which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.

Patches

The patch removes the use of eval:
mozilla/pdf.js#18015

Workarounds

Set the option isEvalSupported to false.

References

https://bugzilla.mozilla.org/show_bug.cgi?id=1893645

Severity

High

CVE ID

No known CVE

Weaknesses

No CWEs

Credits