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-2023-44271

CVE-2023-44271: Python Pillow DOS Vulnerability

CVE-2023-44271 is a denial of service flaw in Python Pillow that causes uncontrolled memory allocation when processing long text arguments. This post covers technical details, affected versions, and mitigation steps.

Published: February 4, 2026

CVE-2023-44271 Overview

CVE-2023-44271 is a Denial of Service (DoS) vulnerability discovered in Python Pillow versions prior to 10.0.0. The vulnerability allows attackers to cause uncontrolled memory allocation when processing TrueType fonts through the ImageFont module. Specifically, when the textlength method in an ImageDraw instance operates on an excessively long text argument, the library allocates memory without proper bounds checking, potentially exhausting system memory and causing service crashes.

This vulnerability is particularly concerning for web applications and services that process user-supplied text for image generation, such as watermarking services, meme generators, certificate generators, or any application that renders dynamic text onto images using Pillow.

Critical Impact

Attackers can crash Python applications using Pillow by supplying extremely long text strings to font rendering functions, causing memory exhaustion and denial of service without authentication.

Affected Products

  • Python Pillow versions prior to 10.0.0
  • Fedora 38 (packaged Pillow)
  • Any application using vulnerable Pillow versions for text rendering

Discovery Timeline

  • 2023-11-03 - CVE-2023-44271 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-44271

Vulnerability Analysis

The vulnerability resides in Pillow's ImageFont module, which handles TrueType font rendering. When applications use the textlength method or similar text rendering functions with user-controlled input, no limit is enforced on the length of the text string that can be processed. This architectural oversight allows an attacker to submit arbitrarily long strings that consume increasing amounts of memory during font metric calculations and glyph processing.

The memory consumption grows proportionally with the input string length. Since there was no upper bound on acceptable string lengths, an attacker could craft requests with extremely long text values (potentially millions of characters) that would cause the Pillow library to allocate memory until the system runs out of available resources.

This vulnerability falls under CWE-770 (Allocation of Resources Without Limits or Throttling), a common weakness pattern where software does not properly limit the amount of resources allocated in response to external input.

Root Cause

The root cause is the absence of input validation on the length of text strings passed to ImageFont methods. Before the fix, Pillow would attempt to process any text string regardless of its length, leading to unbounded memory allocation. The library lacked a safeguard mechanism to reject or truncate excessively long text inputs before memory allocation occurred.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Identifying an application endpoint that accepts text input for image generation
  2. Crafting a request with an extremely long text string (millions of characters)
  3. Submitting the request to trigger Pillow's text rendering functionality
  4. The application's memory usage spikes as Pillow attempts to process the oversized input
  5. Repeated requests can exhaust available system memory, causing the application to crash

The following patch was applied to address this vulnerability by introducing the MAX_STRING_LENGTH limit:

text
+.. warning::
+    To protect against potential DOS attacks when using arbitrary strings as
+    text input, Pillow will raise a ``ValueError`` if the number of characters
+    is over a certain limit, :py:data:`MAX_STRING_LENGTH`.
+
+    This threshold can be changed by setting
+    :py:data:`MAX_STRING_LENGTH`. It can be disabled by setting
+    ``ImageFont.MAX_STRING_LENGTH = None``.

Source: GitHub Pillow Commit

Detection Methods for CVE-2023-44271

Indicators of Compromise

  • Sudden spikes in memory usage on servers running Python applications with Pillow
  • Application crashes with out-of-memory errors in services that generate images with text
  • Unusually large HTTP request payloads targeting image generation endpoints
  • Log entries showing MemoryError or process termination in Python applications
  • Repeated requests to text rendering endpoints with abnormally large request bodies

Detection Strategies

  • Monitor application memory consumption patterns for abnormal spikes during image processing operations
  • Implement request size limits at the web server or application gateway level
  • Review application logs for MemoryError exceptions in code paths involving ImageFont or ImageDraw
  • Use dependency scanning tools to identify applications using Pillow versions below 10.0.0
  • Deploy runtime application self-protection (RASP) to detect resource exhaustion attacks

Monitoring Recommendations

  • Configure memory usage alerts for Python application processes using Pillow
  • Implement request body size limits on endpoints that process text for image generation
  • Set up logging for input validation failures in image processing code paths
  • Monitor container or process memory metrics for services that render dynamic images
  • Enable application performance monitoring (APM) to track memory allocation patterns

How to Mitigate CVE-2023-44271

Immediate Actions Required

  • Upgrade Python Pillow to version 10.0.0 or later immediately
  • Implement input validation to limit text string lengths before passing to Pillow
  • Add memory limits to containerized applications using Pillow
  • Configure web application firewalls (WAF) to reject requests with excessively large text payloads
  • Review and audit all code paths where user input flows into ImageFont or ImageDraw methods

Patch Information

The Pillow development team addressed this vulnerability in version 10.0.0 by introducing the ImageFont.MAX_STRING_LENGTH constant. This setting establishes a default limit on the number of characters that can be processed by ImageFont methods, raising a ValueError when exceeded.

The fix is available through the official GitHub Pillow Pull Request and the security commit. Linux distributions have also released patches, including Debian LTS and Fedora.

Workarounds

  • Implement application-level input validation to limit text string lengths before Pillow processing
  • Set memory limits on application processes using cgroups or container resource constraints
  • Deploy request size limits at the reverse proxy or load balancer level
  • Add rate limiting to endpoints that perform image text rendering
  • Consider using a message queue with timeout mechanisms for image processing tasks
bash
# Upgrade Pillow to the patched version
pip install --upgrade "Pillow>=10.0.0"

# Verify the installed version
pip show pillow | grep Version

# For applications that require custom limits, configure MAX_STRING_LENGTH
# In your Python application:
# from PIL import ImageFont
# ImageFont.MAX_STRING_LENGTH = 10000  # Set custom limit

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

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.15%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-770
  • Technical References
  • Checkmarx CVE-2023-44271 Details

  • Debian LTS Security Notice

  • Fedora Package Announcement
  • Vendor Resources
  • GitHub Pillow Commit

  • GitHub Pillow Pull Request
  • Related CVEs
  • CVE-2021-23437: Python Pillow ReDoS Vulnerability

  • CVE-2024-28219: Python Pillow Buffer Overflow Vulnerability

  • CVE-2025-48379: Python Pillow Buffer Overflow Vulnerability

  • CVE-2023-50447: Python Pillow RCE 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