Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. Pillow
  4. ›
  5. CVE-2022-22817

CVE-2022-22817: Arbitrary expression injection in Pillow

January 12, 2022 (updated October 11, 2024)

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.

References

  • github.com/advisories/GHSA-8vj2-vxx3-667w
  • github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-10.yaml
  • github.com/python-pillow/Pillow
  • github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11
  • lists.debian.org/debian-lts-announce/2022/01/msg00018.html
  • lists.debian.org/debian-lts-announce/2024/03/msg00021.html
  • nvd.nist.gov/vuln/detail/CVE-2022-22817
  • pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html
  • pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html
  • security.gentoo.org/glsa/202211-10
  • www.debian.org/security/2022/dsa-5053

Code Behaviors & Features

Detect and mitigate CVE-2022-22817 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 9.0.1

Fixed versions

  • 9.0.1

Solution

Upgrade to version 9.0.1 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Source file

pypi/Pillow/CVE-2022-22817.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:34 +0000.