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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2026-42310

CVE-2026-42310: Python Pillow DOS Vulnerability

CVE-2026-42310 is a denial of service vulnerability in Python Pillow that allows attackers to cause indefinite hangs via malicious PDFs. This article covers the technical details, affected versions, and mitigation strategies.

Published: May 18, 2026

CVE-2026-42310 Overview

CVE-2026-42310 is a denial of service vulnerability in Pillow, the Python imaging library. Versions from 4.2.0 up to but not including 12.2.0 contain a flaw in the PDF parser that allows a malicious PDF file to trigger an infinite loop. When the parser processes a crafted document whose trailer chain references itself, the process hangs indefinitely, consumes 100% CPU, and renders the host application unresponsive. The issue is tracked as CWE-835 (Loop with Unreachable Exit Condition). The maintainers patched the defect in Pillow version 12.2.0 by detecting cycles in the cross-reference trailer chain.

Critical Impact

A single malicious PDF can lock a Pillow-based image processing pipeline at 100% CPU usage, causing service-wide unavailability for applications that accept untrusted PDF input.

Affected Products

  • Python Pillow versions 4.2.0 through 12.1.x
  • Applications embedding Pillow's PdfParser module for PDF ingestion
  • Image processing pipelines that accept untrusted PDF files

Discovery Timeline

  • 2026-05-09 - CVE-2026-42310 published to NVD
  • 2026-05-12 - Last updated in NVD database

Technical Details for CVE-2026-42310

Vulnerability Analysis

The vulnerability resides in src/PIL/PdfParser.py, specifically in the read_prev_trailer method. PDF files use cross-reference (xref) tables to locate objects within the document. Each trailer may contain a Prev entry pointing to a previous trailer, forming a chain that the parser walks recursively. The parser did not track which trailer offsets it had already visited. An attacker can craft a PDF where a trailer's Prev value references an earlier offset in the chain, creating a cycle. The parser then traverses the same trailers repeatedly without an exit condition, saturating a CPU core until the process is terminated.

Root Cause

The root cause is missing cycle detection during recursive trailer traversal. The read_prev_trailer function accepted an xref_section_offset argument and called itself for each Prev reference, but it kept no record of previously processed offsets. With no termination check, a self-referential trailer chain produced an infinite loop classified under [CWE-835].

Attack Vector

Exploitation requires the victim application to parse an attacker-supplied PDF using Pillow. The attack vector is local in CVSS terms because the malicious file must be presented to the parsing process, but practical exposure includes any service that accepts user-uploaded PDFs and converts them with Pillow, such as document preview generators, OCR pipelines, or thumbnailing services. No authentication or user interaction with the Pillow process itself is required beyond delivering the file.

python
         if b"Prev" in self.trailer_dict:
             self.read_prev_trailer(self.trailer_dict[b"Prev"])
 
-    def read_prev_trailer(self, xref_section_offset: int) -> None:
+    def read_prev_trailer(
+        self, xref_section_offset: int, processed_offsets: list[int] = []
+    ) -> None:
         assert self.buf is not None
         trailer_offset = self.read_xref_table(xref_section_offset=xref_section_offset)
         m = self.re_trailer_prev.search(

Source: Pillow commit 3bf614e. The patch adds a processed_offsets list so the parser raises an error when the trailer chain loops back on itself.

Detection Methods for CVE-2026-42310

Indicators of Compromise

  • A Python worker process executing Pillow's PdfParser sustaining 100% CPU on a single core for an extended period.
  • Application threads stalled inside PIL/PdfParser.py frames, particularly read_prev_trailer and read_xref_table.
  • PDF inputs containing self-referential Prev offsets in their trailer dictionaries.

Detection Strategies

  • Inventory installed Pillow versions across hosts and containers using package managers such as pip list or SBOM tooling, and flag versions earlier than 12.2.0.
  • Add file-format validation that parses incoming PDFs with a lightweight library to reject documents whose xref chains contain cycles before handing them to Pillow.
  • Instrument PDF-processing workers with execution timeouts so a hung parse is terminated and logged.

Monitoring Recommendations

  • Alert on Python processes that hold sustained CPU above a threshold while parsing user-uploaded files.
  • Track the count of PDF parse jobs that exceed expected duration and correlate with the uploading user or source IP.
  • Log SHA-256 hashes of PDF inputs that trigger timeouts to support hunting and indicator sharing.

How to Mitigate CVE-2026-42310

Immediate Actions Required

  • Upgrade Pillow to version 12.2.0 or later on all systems where it is installed.
  • Rebuild and redeploy container images that bundle vulnerable Pillow versions.
  • Audit downstream dependencies that pin Pillow below 12.2.0 and request updates from those maintainers.

Patch Information

The fix is included in Pillow 12.2.0. Review the GitHub Security Advisory GHSA-r73j-pqj5-w3x7, the Pillow 12.2.0 release notes, and the pull request #9519 for full remediation details.

Workarounds

  • Enforce a hard wall-clock timeout around any Pillow PDF parsing call so a hung worker is killed and restarted.
  • Run PDF parsing in isolated subprocesses with CPU and memory limits using resource.setrlimit or container-level cgroup constraints.
  • Pre-validate PDFs with a separate parser and reject files whose trailer Prev chain revisits an earlier offset.
bash
# Upgrade Pillow to the patched release
pip install --upgrade "Pillow>=12.2.0"

# Verify the installed version
python -c "import PIL; print(PIL.__version__)"

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechPython Pillow

  • SeverityMEDIUM

  • CVSS Score5.1

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-835
  • Technical References
  • GitHub Release Version 12.2.0
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Pull Request

  • GitHub Security Advisory GHSA-r73j-pqj5-w3x7
  • Related CVEs
  • CVE-2023-44271: Python Pillow DOS Vulnerability

  • CVE-2021-23437: Python Pillow ReDoS Vulnerability

  • CVE-2026-42311: Python Pillow RCE Vulnerability

  • CVE-2026-42309: Python Pillow Buffer Overflow Vulnerability
Default Legacy - Prefooter | 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