cve.bz

CVE-2023-50447 Code Injection

8.1 highEPSS 1.7%Fix available

High (8.1). EPSS 1.7% estimated probability of exploitation activity in the next 30 days. Fixed in pillow 10.2.0.

On this page
Pillow through 10.1.0 allows PIL.ImageMath.eval Arbitrary Code Execution via the environment parameter, a different vulnerability than CVE-2022-22817 (which was about the expression parameter).

Severity

CVSS 3.1

8.1 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
1.7% (unchanged from 1.7% a week ago; 1.7% 30 days ago) estimated probability of exploitation activity in the next 30 days; 78th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2024-07-19. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-94 Improper Control of Generation of Code (Code Injection)
CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code (Eval Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2023-50447 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-50447?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-50447?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-50447 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
python:pillowthrough 10.1.0
debian:debian_linux10.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-3f63-hfp8-52jqPyPIpillow<10.2.010.2.0
PYSEC-2026-457PyPIpillow<10.2.010.2.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10pillow5.4.1-2+deb10u4DLA-3724-1
Debian11pillow8.1.2+dfsg-0.3+deb11u2DSA-5704-1
Debian12pillow9.4.0-1.1+deb12u1DEBIAN-CVE-2023-50447 DSA-5704-1
Debian13, 14pillow10.2.0-1DEBIAN-CVE-2023-50447
Ubuntu20.04:LTSpillow7.0.0-4ubuntu0.8UBUNTU-CVE-2023-50447 USN-6618-1
Ubuntu22.04:LTSpillow9.0.1-1ubuntu0.2UBUNTU-CVE-2023-50447 USN-6618-1
Ubuntu24.04:LTSpillow10.2.0-1UBUNTU-CVE-2023-50447
UbuntuPro:14.04:LTSpillow2.3.0-1ubuntu3.4+esm5UBUNTU-CVE-2023-50447
UbuntuPro:16.04:LTSpillow3.1.2-0ubuntu1.6+esm3UBUNTU-CVE-2023-50447
UbuntuPro:18.04:LTSpillow5.1.0-1ubuntu0.8+esm2UBUNTU-CVE-2023-50447
UbuntuPro:20.04:LTSpillow-python2no fix listedUBUNTU-CVE-2023-50447
Red Hatansible_automation_platform:2.4::el8automation-controller-venv-tower0:4.5.7-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8automation-hub, python39-galaxy-ng, python3x-galaxy-ng0:4.9.2-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-aiohttp, python3x-aiohttp, python39-aiohttp-debuginfo and 1 more0:3.9.5-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-gunicorn, python3x-gunicorn0:22.0.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-pillow, python3x-pillow, python39-pillow-debuginfo and 1 more0:10.3.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-pydantic, python3x-pydantic0:1.10.15-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-social-auth-app-django, python3x-social-auth-app-django0:5.4.1-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-sqlparse, python3x-sqlparse0:0.5.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8python39-idna, python3x-idna0:3.7-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8python39-requests, python3x-requests0:2.32.2-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-black, python3x-black0:22.8.0-2.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-cryptography, python3x-cryptography, python39-cryptography-debuginfo and 1 more0:42.0.5-1.el8apRHSA-2024:3781
25 more for Red Hat in the JSON and on Red Hat's page.
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8python-Pillow4.2.1-3.26.1SUSE-SU-2024:0290-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise Module for Python 3 15 SP5 and 2 morepython-Pillow9.5.0-150400.5.9.1SUSE-SU-2024:0205-1
SUSEOpenStack Cloud 9, OpenStack Cloud Crowbar 9python-Pillow5.2.0-3.23.1SUSE-SU-2024:0439-1
SUSEPackage Hub 15 SP5python-Pillow8.4.0-bp155.3.3.1openSUSE-SU-2024:0125-1
openSUSELeap 15.5python-Pillow7.2.0-150300.3.6.1SUSE-SU-2024:0185-1
openSUSELeap 15.5python-Pillow8.4.0-bp155.3.3.1openSUSE-SU-2024:0125-1
openSUSELeap 15.5python-Pillow9.5.0-150400.5.9.1SUSE-SU-2024:0205-1
openSUSETumbleweedpython-Pillow10.2.0-1.1openSUSE-SU-2024:13611-1
openSUSETumbleweedpython-Pillow12.3.0-1.1openSUSE-SU-2026:11261-1
AlmaLinux8python3-pillow, python3-pillow-tk, python3-pillow-doc and 1 more5.1.1-18.el8_9.1.alma.1ALSA-2024:0893
Alpinev3.19, v3.20, v3.21 and 3 morepy3-pillow10.2.0-r0ALPINE-CVE-2023-50447

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

The vulnerability in Pillow's PIL.ImageMath.eval function poses a significant threat due to its potential for arbitrary code execution. Pillow's widespread use in diverse domains makes this flaw particularly impactful, as it could lead to unauthorized access, data breaches, and compromise of entire systems. The complex exploitation method involving Python's dunder methods adds sophistication to potential attacks.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-pillow-0:10.3.0-1.el8apFixed 2024-06-10RHSA-2024:3781
Red Hat Ansible Automation Platform 2.4 for RHEL 9python-pillow-0:10.3.0-1.el9apFixed 2024-06-10RHSA-2024:3781
Red Hat Enterprise Linux 7python-pillow-0:2.0.0-25.gitd1c6db8.el7_9Fixed 2024-02-19RHSA-2024:0857
Red Hat Enterprise Linux 8python-pillow-0:5.1.1-18.el8_9.1Fixed 2024-02-20RHSA-2024:0893
Red Hat Enterprise Linux 8.2 Advanced Update Supportpython-pillow-0:5.1.1-15.el8_2Fixed 2024-02-29RHSA-2024:1059
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportpython-pillow-0:5.1.1-15.el8_4Fixed 2024-02-29RHSA-2024:1060
Red Hat Enterprise Linux 8.4 Telecommunications Update Servicepython-pillow-0:5.1.1-15.el8_4Fixed 2024-02-29RHSA-2024:1060
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutionspython-pillow-0:5.1.1-15.el8_4Fixed 2024-02-29RHSA-2024:1060
Red Hat Enterprise Linux 8.6 Extended Update Supportpython-pillow-0:5.1.1-19.el8_6Fixed 2024-02-29RHSA-2024:1058
Red Hat Enterprise Linux 8.8 Extended Update Supportpython-pillow-0:5.1.1-19.el8_8Fixed 2024-02-08RHSA-2024:0754

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2023-50447.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-25-203-04Schneider Electric EcoStruxure Power Operation (Update A)2025-07-22Commercial Facilities, Critical Manufacturing, EnergySchneider Electric EcoStruxure Power Operation (EPO) 2022: <=CU6, Schneider Electric EcoStruxure Power Operation (EPO) 2024: <=CU1none listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON