Vulnerabilities/

PDF.js: Arbitrary JavaScript execution upon opening a malicious PDF

Severity:
High

Description

If PDF.js is used to load a malicious PDF, and PDF.js is configured with enableScripting set to true (which is the default value) and no CSP for disallowing script-src, unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.

Recommendation

Update the pdfjs-dist package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
pdfjs-dist
Anything's wrong? Let us know Last updated on August 06, 2026