CVE-2022-22817

PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method

Critical · published January 7, 2022

CVSS v3.1
9.8
EPSS
3%
Percentile
88.6
In the wild
Unconfirmed
What it is

🔥 Pillow before version 9.0.0 has a critical flaw that lets attackers evaluate arbitrary expressions, including those that use Python’s exec method, making it a big target for trouble! Think of it like having a chef who can follow any recipe without checking if the ingredients are safe — if they follow a dangerous recipe, it could lead to a disastrous meal! An attacker could use this vulnerability to run malicious code remotely, gaining complete control over the application. This could lead to unauthorized access to sensitive data or even full system compromise! It's a recipe for chaos that must be addressed immediately!

Put simply

Think of it like having a chef who can follow any recipe without checking if the ingredients are safe — if they follow a dangerous recipe, it could lead to a disastrous meal! This flaw in Pillow's PIL.ImageMath.eval allows execution of arbitrary expressions by leveraging Python's exec capabilities, which can be exploited to run harmful commands within the application's context.

What to do

An attacker could use this vulnerability to run malicious code remotely, gaining complete control over the application. This could lead to unauthorized access to sensitive data or even full system compromise! It's a recipe for chaos that must be addressed immediately! Update Pillow to version 9.0.0 or later immediately to patch this vulnerability. Review your application code to identify and mitigate any uses of PIL.ImageMath.eval that could be exploited. Don't wait—secure your code now! You've got this! With these steps, you'll be the security hero your application needs! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.03334 · 88.6th percentile
Published
2022-01-07T00:00Z
EPSS history
Timeline
  • 07 JAN 00:00Z
    PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method
    cvelistv5