Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2024-34342: Arbitrary JavaScript Execution in react-pdf via PDF.js isEvalSupported

Published May 7, 2024 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.1High · v3.1
EPSS1.1%65th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
IdentifiersCVE-2024-34342CWE-94

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.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

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.

Public exploits

Exploits

1 exploit validated by Mallory's analysis.

View more in app →
CVE-2024-4367-hands-on-01This repository is primarily a hands-on/lab environment for CVE-2024-4367 in PDF.js, not just a standalone exploit. The core exploit is CVE-2024-4367-PoC/CVE-2024-4367.py, a Python script that generates a malicious PDF by embedding attacker-controlled JavaScript into the PDF FontMatrix structure. When the resulting poc.pdf is opened by a vulnerable PDF.js consumer, the injected JavaScript executes in the PDF.js/hosting origin context. The README explicitly demonstrates both browser-context JavaScript execution (e.g., alert(document.domain)) and, in Electron-style environments, command execution via require('child_process').exec(...). Repository structure: (1) CVE-2024-4367-PoC/ contains the actual exploit generator and exploit README; (2) firefox.py automates downloading specific Firefox Nightly builds and launching poc.pdf to demonstrate vulnerable vs patched behavior; (3) pdfjs_diff_font_renderer.js is a diff artifact showing vulnerable vs fixed font renderer logic; (4) the rest of the repository is largely a PDF.js code/examples tree, including browser examples, Node examples, and a Chromium extension implementation. Those files are mostly supporting context for understanding or reproducing the vulnerability rather than additional exploit stages. Main exploit capability: arbitrary JavaScript execution triggered by opening a crafted PDF file. Secondary capability: potential local command execution in Electron-based hosts where Node integration is exposed. There is no built-in network callback, C2, or exfiltration logic in the exploit itself; payload behavior is entirely user-supplied JavaScript. The exploit is file-delivered and relies on a victim opening the generated PDF in a vulnerable PDF.js environment. The included Firefox launcher script and versioned Nightly download URLs make the repository useful for reproducible testing and patch verification.yuimamur · Disclosed Jul 27, 2026 · python · javascript · file · browser · webOperational
FAQ

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.
Activity feed

Recent activity

No public activity tracked yet. Mallory keeps watching.

View more in app →

No public activity observed for this vulnerability.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.