CVE-2023-50447
Python vulnerability analysis and mitigation

Overview

CVE-2023-50447 affects Pillow through version 10.1.0, a popular Python imaging library. The vulnerability allows arbitrary code execution via the environment parameter in PIL.ImageMath.eval function, distinct from the previously identified CVE-2022-22817 which involved the expression parameter (NVD, Checkmarx).

Technical details

The vulnerability exists in the PIL.ImageMath.eval function's environment parameter validation. The issue stems from insufficient filtering of environment keys that could potentially contain names matching Python builtins or containing double underscores, enabling arbitrary code execution. The vulnerability has a CVSS v3.1 base score of 8.1 (HIGH) with vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD, Researcher Blog).

Impact

If an attacker has control over the keys passed to the environment argument of PIL.ImageMath.eval(), they can potentially execute arbitrary code on the target system. This could lead to complete system compromise, affecting the confidentiality, integrity, and availability of the system (Checkmarx).

Mitigation and workarounds

The vulnerability has been fixed in Pillow version 10.2.0. The fix implements validation that raises a ValueError for keys matching the names of builtins and keys containing double underscores. Users are strongly recommended to upgrade to version 10.2.0 or later (Pillow Release).

Community reactions

The vulnerability was discovered during Checkmarx's Research Group routine security assessments of open-source technologies. The Pillow maintainers responded efficiently to the report and implemented a fix, which was acknowledged by the security researcher (Researcher Blog).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22033HIGH8.6
  • PythonPython
  • label-studio
NoNoJan 12, 2026
CVE-2025-68472HIGH8.1
  • PythonPython
  • mindsdb
NoYesJan 12, 2026
CVE-2026-22251MEDIUM5.3
  • PythonPython
  • wlc
NoYesJan 12, 2026
CVE-2026-22691LOW2.7
  • PythonPython
  • pypdf2
NoYesJan 10, 2026
CVE-2026-22250LOW2.5
  • PythonPython
  • wlc
NoYesJan 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management