CVE-2024-34342: Arbitrary JavaScript Execution in react-pdf via PDF.js isEvalSupported
CVE-2024-34342 affects react-pdf, a library for rendering PDFs in React applications. When react-pdf uses PDF.js to load a malicious PDF, and PDF.js is operating with isEvalSupported set to true (the default behavior referenced in the advisory), attacker-controlled JavaScript embedded in the PDF can be executed without restriction in the security context of the hosting web application domain. The issue is therefore a script execution flaw triggered by opening a crafted PDF through the vulnerable integration. Fixed releases are 7.7.3 and 8.0.2.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation results in unrestricted attacker-controlled JavaScript execution in the origin context of the affected hosting domain. This can enable theft of session data and tokens accessible to client-side code, DOM manipulation, actions on behalf of the user within the application, access to sensitive application data exposed to the browser, and broader compromise equivalent to a same-origin XSS-style execution primitive.
Mitigation
If you can’t patch tonight, do this now.
If immediate upgrade is not possible, explicitly set options.isEvalSupported to false on the react-pdf Document component to disable the vulnerable PDF.js behavior when rendering PDFs. More generally, avoid rendering untrusted PDFs in-browser until the fixed version is deployed.
Remediation
Patch, then assume compromise.
Upgrade react-pdf to a fixed version: 7.7.3 or later on the 7.x branch, or 8.0.2 or later on the 8.x branch. According to the advisory, the fix forces isEvalSupported to false, eliminating the vulnerable PDF.js execution path.
Exploits
1 exploit validated by Mallory's analysis.
References
Frequently asked questions
- Is CVE-2024-34342 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2024-34342 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2024-34342?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2024-34342, the earliest disclosed Jul 27, 2026.
- Is there a patch for CVE-2024-34342?
- Upgrade react-pdf to a fixed version: 7.7.3 or later on the 7.x branch, or 8.0.2 or later on the 8.x branch. According to the advisory, the fix forces isEvalSupported to false, eliminating the vulnerable PDF.js execution path.
- How severe is CVE-2024-34342?
- CVE-2024-34342 has a CVSS v3.1 score of 7.1 (High) and an EPSS score of 1.1% (65th percentile) as of Oct 16, 2026.
Recent activity
No public activity tracked yet. Mallory keeps watching.
No public activity observed for this vulnerability.