The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-34342

CVE-2024-34342: react-pdf RCE Vulnerability

CVE-2024-34342 is a remote code execution vulnerability in react-pdf that allows attackers to execute malicious JavaScript through crafted PDFs. This article covers technical details, affected versions, impact, and mitigation.

Published: January 28, 2026

CVE-2024-34342 Overview

CVE-2024-34342 is a Cross-Site Scripting (XSS) vulnerability affecting react-pdf, a popular library used to display PDFs in React applications. When PDF.js is used to load a malicious PDF document and the isEvalSupported configuration option is set to true (which is the default value), an attacker can execute unrestricted JavaScript code in the context of the hosting domain. This vulnerability represents a significant security risk for web applications that allow user-uploaded or externally-sourced PDF files.

Critical Impact

Attackers can execute arbitrary JavaScript in the context of the victim's browser session, potentially leading to session hijacking, data theft, or complete account takeover on affected applications.

Affected Products

  • react-pdf versions prior to 7.7.3
  • react-pdf versions 8.x prior to 8.0.2
  • Applications using PDF.js with isEvalSupported set to true (default)

Discovery Timeline

  • 2024-05-07 - CVE-2024-34342 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2024-34342

Vulnerability Analysis

This vulnerability stems from the way PDF.js handles JavaScript execution within PDF documents. The isEvalSupported configuration option, when set to true, allows the PDF.js library to use JavaScript's eval() function for performance optimization when rendering certain PDF features. However, this creates a dangerous attack surface where malicious JavaScript embedded within a crafted PDF document can be executed with the same privileges as the hosting web application.

The vulnerability is classified as CWE-79 (Cross-Site Scripting), as it allows attackers to inject and execute malicious scripts in the context of a trusted web application. The attack requires user interaction, specifically requiring the victim to view a malicious PDF document through an affected application. The network-based attack vector combined with the potential for high confidentiality and integrity impact makes this vulnerability particularly concerning for applications that process user-uploaded PDF files.

Root Cause

The root cause of this vulnerability lies in the insecure default configuration of the isEvalSupported option in PDF.js. When enabled, the library uses dynamic code evaluation to process certain PDF features, which can be abused by attackers who craft malicious PDF files containing JavaScript payloads. The react-pdf library, which wraps PDF.js for React applications, inherited this vulnerable default configuration.

Attack Vector

The attack requires an adversary to craft a malicious PDF file containing embedded JavaScript code. When a victim views this PDF through a vulnerable react-pdf implementation, the malicious JavaScript executes within the browser context of the hosting domain. This can be achieved through various means including:

  • Uploading a malicious PDF to a file sharing platform
  • Sending the malicious PDF via email with a link to view it in an affected application
  • Hosting the malicious PDF and convincing users to view it through a vulnerable document viewer

The attacker-controlled JavaScript can then access cookies, session tokens, and other sensitive data, perform actions on behalf of the authenticated user, or redirect users to malicious websites.

Detection Methods for CVE-2024-34342

Indicators of Compromise

  • Unexpected JavaScript execution events originating from PDF rendering components
  • Suspicious PDF files containing embedded JavaScript with unusual or obfuscated code
  • Client-side errors or anomalous behavior when rendering PDF documents
  • Network requests to unauthorized external domains initiated from PDF viewer contexts

Detection Strategies

  • Implement Content Security Policy (CSP) headers to detect and block unauthorized script execution
  • Monitor client-side JavaScript errors for anomalies related to PDF rendering
  • Analyze uploaded PDF files for embedded JavaScript content before allowing viewing
  • Deploy web application firewalls with rules to inspect PDF content for malicious payloads

Monitoring Recommendations

  • Enable logging for all PDF file uploads and rendering events in affected applications
  • Monitor for CSP violation reports that may indicate attempted exploitation
  • Implement file integrity monitoring for any cached or stored PDF files
  • Set up alerts for unusual patterns in PDF-related JavaScript execution

How to Mitigate CVE-2024-34342

Immediate Actions Required

  • Update react-pdf to version 7.7.3 or later for the 7.x branch
  • Update react-pdf to version 8.0.2 or later for the 8.x branch
  • Set isEvalSupported to false in PDF.js configuration as a temporary workaround
  • Review and audit any applications that allow user-uploaded PDF files

Patch Information

The vulnerability has been fixed in react-pdf versions 7.7.3 and 8.0.2. The fixes address the insecure default configuration and prevent malicious JavaScript execution from PDF documents. For detailed information about the patches, refer to the React PDF Security Advisory and the related Mozilla PDF.js Security Advisory.

Workarounds

  • Configure isEvalSupported to false in your PDF.js options to disable dynamic code evaluation
  • Implement server-side PDF sanitization to strip embedded JavaScript before serving files
  • Use Content Security Policy headers to restrict script execution sources
  • Consider implementing PDF file validation that rejects documents containing JavaScript
bash
# Configuration example for disabling isEvalSupported in react-pdf
# In your React component where you initialize the PDF viewer:
# Set the options object with isEvalSupported: false

# Example npm commands to update to patched versions:
npm update react-pdf@7.7.3  # For 7.x branch
npm update react-pdf@8.0.2  # For 8.x branch

# Verify installed version
npm list react-pdf

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechReact Pdf

  • SeverityHIGH

  • CVSS Score7.1

  • EPSS Probability5.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityHigh
  • AvailabilityLow
  • CWE References
  • CWE-79
  • Technical References
  • Mozilla PDF.js Commit

  • Mozilla PDF.js Pull Request

  • Mozilla PDF.js Security Advisory

  • React PDF Commit Update

  • React PDF Commit Change

  • React PDF Security Advisory
  • Latest CVEs
  • CVE-2026-35467: Browser API Key Information Disclosure

  • CVE-2026-35466: cveInterface.js XSS Vulnerability

  • CVE-2026-30252: ZenShare Suite XSS Vulnerability

  • CVE-2026-30251: ZenShare Suite v17.0 XSS Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English