Recent discoveries have unearthed significant security flaws in PDF.js and React-PDF, both widely used for PDF viewing in web applications. These vulnerabilities, identified as CVE-2024-4367 and CVE-2024-34342, arise from improper handling of JavaScript within PDF files, allowing for the execution of arbitrary JavaScript code.
These vulnerabilities impact millions of users by potentially allowing attackers to steal sensitive information like cookies and session tokens, or perform actions on behalf of the user without their consent.
Affected Applications and Versions
PDF.js: Versions up to 4.1.392 are vulnerable.
React-PDF: Affects versions up to 7.7.2 and from 8.0.0 to 8.0.1.
The flaw is triggered when a malicious PDF is loaded by PDF.js or React-PDF with the isEvalSupported setting enabled, which is true by default.
It is recommended that users upgrade to the following versions to ensure security:
PDF.js: Version 4.2.67 or later.
React-PDF: Version 7.7.3 or 8.0.2 and beyond.
It's also recommended to set isEvalSupported to false to prevent the execution of potentially malicious scripts.
To fix your vulnerable patches, please visit the PDF.js and React-PDF patch release pages.