react-pdf vulnerable to arbitrary JavaScript execution upon opening a malicious PDF with PDF.js
Description
Published by the National Vulnerability Database
May 7, 2024
Published to the GitHub Advisory Database
May 7, 2024
Reviewed
May 7, 2024
Last updated
May 8, 2024
Summary
If PDF.js is used to load a malicious PDF, and PDF.js is configured with
isEvalSupportedset totrue(which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.Patches
This patch forces
isEvalSupportedtofalse, removing the attack vector.Workarounds
Set
options.isEvalSupportedtofalse, whereoptionsisDocumentcomponent prop.References
References