You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
PDF.js: Arbitrary JavaScript execution upon opening a malicious PDF
High severity
GitHub Reviewed
Published
Jul 28, 2026
in
mozilla/pdf.js
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.
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Learn more on MITRE.
Impact
If PDF.js is used to load a malicious PDF, and PDF.js is configured with
enableScriptingset 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.Patches
Workarounds
Set
enableScriptingtofalseor set a CSP.References