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-50447

CVE-2023-50447: Python Pillow RCE Vulnerability

CVE-2023-50447 is a remote code execution vulnerability in Python Pillow affecting versions through 10.1.0 via the PIL.ImageMath.eval environment parameter. This article covers technical details, affected versions, and mitigation.

Published: February 11, 2026

CVE-2023-50447 Overview

CVE-2023-50447 is an arbitrary code execution vulnerability affecting Python Pillow, a widely-used Python Imaging Library fork. The vulnerability exists in the PIL.ImageMath.eval function, which allows attackers to execute arbitrary code via the environment parameter. This is a distinct vulnerability from CVE-2022-22817, which targeted the expression parameter of the same function.

Critical Impact

Successful exploitation allows remote attackers to execute arbitrary code on systems running vulnerable versions of Pillow, potentially leading to complete system compromise, data exfiltration, or lateral movement within an organization's infrastructure.

Affected Products

  • Python Pillow through version 10.1.0
  • Debian Linux 10.0
  • Any application or service utilizing vulnerable Pillow versions for image processing

Discovery Timeline

  • 2024-01-19 - CVE-2023-50447 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-50447

Vulnerability Analysis

The vulnerability resides in the PIL.ImageMath.eval() function, a utility designed to evaluate image expressions. The function accepts an environment parameter that defines variables available during expression evaluation. Due to insufficient input validation, an attacker can craft a malicious environment dictionary that results in arbitrary Python code execution when the expression is evaluated.

This vulnerability is classified under CWE-94 (Improper Control of Generation of Code) and CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code), indicating that the core issue stems from the application's failure to properly sanitize or restrict the types of objects that can be passed through the environment parameter before code evaluation occurs.

Root Cause

The root cause of CVE-2023-50447 is improper input validation in the PIL.ImageMath.eval() function's handling of the environment parameter. The function does not adequately restrict or sanitize the objects that can be passed into the evaluation context, allowing attackers to inject callable objects or code references that execute when the expression is processed. This differs from CVE-2022-22817, which addressed similar issues in the expression parameter—demonstrating that the original fix was incomplete.

Attack Vector

The attack vector for this vulnerability is network-based. An attacker can exploit this vulnerability remotely by providing malicious input to applications that:

  1. Accept user-controlled data that eventually reaches the PIL.ImageMath.eval() function
  2. Pass user-influenced objects into the environment parameter
  3. Process untrusted image data or image-related expressions

Applications that use Pillow for server-side image processing, content management systems with image manipulation features, or web services handling user-uploaded images are particularly at risk. The exploitation requires crafting specific Python objects in the environment dictionary that, when evaluated, execute attacker-controlled code.

For detailed technical analysis and exploitation mechanics, refer to the Duarte C. Santos CVE-2023-50447 Analysis and the Checkmarx CVE-2023-50447 Details.

Detection Methods for CVE-2023-50447

Indicators of Compromise

  • Unexpected Python process spawns originating from web application or image processing services
  • Anomalous network connections from servers running Pillow-based applications
  • Unusual file system activity or modifications in directories accessible to image processing components
  • Log entries showing errors or exceptions related to PIL.ImageMath.eval() with suspicious parameters

Detection Strategies

  • Implement application-level logging to capture all calls to PIL.ImageMath.eval() with their parameters
  • Deploy runtime application self-protection (RASP) solutions to detect code injection attempts
  • Use static code analysis tools to identify vulnerable usage patterns of PIL.ImageMath.eval() in your codebase
  • Monitor Python process behavior for signs of code execution anomalies

Monitoring Recommendations

  • Configure intrusion detection systems to alert on suspicious Python interpreter activity
  • Implement file integrity monitoring on critical system directories
  • Set up alerts for unexpected outbound network connections from image processing servers
  • Review application logs regularly for ImageMath.eval() related exceptions or errors

How to Mitigate CVE-2023-50447

Immediate Actions Required

  • Upgrade Python Pillow to version 10.2.0 or later immediately
  • Audit application code for any usage of PIL.ImageMath.eval() with user-controlled environment parameters
  • Implement input validation to restrict what can be passed to the environment parameter
  • Consider removing or disabling ImageMath.eval() functionality if not essential to your application

Patch Information

The vulnerability is addressed in Pillow versions released after 10.1.0. Organizations should update to the latest stable release available from the Pillow GitHub Release Notes. Debian users should apply updates per the Debian LTS Security Announcement.

Additional details are available in the Openwall OSS Security Discussion.

Workarounds

  • Avoid using PIL.ImageMath.eval() with any user-controlled input
  • Implement strict allowlisting for objects permitted in the environment parameter
  • Isolate image processing functionality in sandboxed containers with minimal privileges
  • Apply network segmentation to limit the blast radius if exploitation occurs
bash
# Upgrade Pillow to patched version
pip install --upgrade Pillow>=10.2.0

# Verify installed version
pip show Pillow | grep Version

# For system-wide installation
sudo pip3 install --upgrade Pillow>=10.2.0

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPython Pillow

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.75%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94

  • CWE-95
  • Technical References
  • Openwall OSS Security Discussion

  • Checkmarx CVE-2023-50447 Details

  • Duarte C. Santos CVE-2023-50447 Analysis

  • Pillow GitHub Release Notes

  • Debian LTS Security Announcement
  • Related CVEs
  • CVE-2022-22817: Python Pillow RCE Vulnerability

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

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

  • CVE-2023-44271: Python Pillow DOS 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