CVE-2022-22817
JSON

9.8critical

Arbitrary expression injection in Pillow

Severity
9.8critical CVSS:3.1 by CISA-ADP
Exploit likelihood
3.68% (higher than 89% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-8vj2-vxx3-667wBIT-PILLOW-2022-22817PYSEC-2022-10

Description

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
pillow (PyPI)before 9.0.1, before 9.0.0GitHub Advisory Database, PyPA Advisory Database
python pillowbefore 9.0.1NVD
debian debian_linux9.0, 10.0, 11.0NVD
pillow (Bitnami)before 9.0.1Bitnami Vulnerability Database

All scores

CISA-ADP9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P
Bitnami Vulnerability Databasecritical rating

Classification

CWE-74

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

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

While Pillow 9.0.0 restricted top-level builtins available to PIL.ImageMath.eval(), it did not prevent builtins available to lambda expressions. These are now also restricted in 9.0.1.

NVD (es)

PIL.ImageMath.eval en Pillow antes de la versión 9.0.0 permite la evaluación de expresiones arbitrarias, como las que utilizan el método exec de Python. También se puede utilizar una expresión lambda,

PyPA Advisory Database

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

References

https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-evaladvisory, release-notes, vendor-advisory, web
https://lists.debian.org/debian-lts-announce/2022/01/msg00018.htmladvisory, mailing-list, third-party-advisory, web
https://www.debian.org/security/2022/dsa-5053advisory, third-party-advisory, vendor-advisory, web
https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#securityadvisory, release-notes, vendor-advisory, web
https://security.gentoo.org/glsa/202211-10advisory, third-party-advisory, vendor-advisory, web
https://lists.debian.org/debian-lts-announce/2024/03/msg00021.htmlmailing-list, web
https://nvd.nist.gov/vuln/detail/CVE-2022-22817advisory, web
https://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11web
https://github.com/advisories/GHSA-8vj2-vxx3-667wadvisory
https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-10.yamlweb
https://github.com/python-pillow/Pillowpackage

Sources

SourceRecordLicence
CVE ListCVE-2022-22817 changed 2024-10-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-8vj2-vxx3-667w changed 2024-10-14CC-BY-4.0
NVDCVE-2022-22817 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2022-10 changed 2023-12-06CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-PILLOW-2022-22817 changed 2026-09-08Apache-2.0