CVE-2022-22817
Python vulnerability analysis and mitigation

Overview

PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method. A lambda expression could also be used. The vulnerability was initially discovered and disclosed in January 2022, affecting the Python Imaging Library (PIL) Pillow package (Pillow Release Notes).

Technical details

The vulnerability exists in the PIL.ImageMath.eval functionality of Pillow versions prior to 9.0.0. The issue allows for unrestricted evaluation of arbitrary expressions, including those using the Python exec method and lambda expressions. The vulnerability has been assigned a CVSS v3.1 Base Score of 9.8 (CRITICAL) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

The vulnerability could potentially lead to arbitrary code execution if an attacker can provide malicious input to the ImageMath.eval function. This could result in complete system compromise, allowing attackers to execute arbitrary commands with the privileges of the application running the Pillow library (Debian Security).

Mitigation and workarounds

The vulnerability was initially addressed in Pillow 9.0.0 by restricting the builtins available to PIL.ImageMath.eval(). However, this fix was incomplete as it did not prevent builtins available to lambda expressions. A complete fix was provided in version 9.0.1. Users are recommended to upgrade to Pillow version 9.0.1 or later (Pillow Release Notes).

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-2025-67511CRITICAL9.6
  • PythonPython
  • cai-framework
NoNoDec 11, 2025
CVE-2025-13780CRITICAL9.1
  • PythonPython
  • cpe:2.3:a:pgadmin:pgadmin
NoYesDec 11, 2025
CVE-2025-67644HIGH7.3
  • PythonPython
  • langgraph-checkpoint-sqlite
NoYesDec 11, 2025
CVE-2025-67720MEDIUM6.5
  • PythonPython
  • pyrofork
NoYesDec 11, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 10, 2025

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