What’s Vulnerable › Vulnerabilities
CVE-2022-22817: Arbitrary expression injection in Pillow
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 3.3% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-01-10 · updated 2026-06-17
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 products
- Debian Linux: 9.0, 10.0, 11.0
- python-pillow Pillow: before 9.0.1 — fixed in 9.0.1
- Pypi Pillow: before 9.0.0; 1.0, 1.1, 1.2, 1.3, 1.4, 1.5 (+78) — fixed in 9.0.0
How to fix
Upgrade to a fixed version: python-pillow Pillow 9.0.1; Pypi Pillow 9.0.0. Check the vendor advisory for mitigations.
References
- https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html
- https://lists.debian.org/debian-lts-announce/2024/03/msg00021.html
- https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval
- https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security
- https://security.gentoo.org/glsa/202211-10
- https://www.debian.org/security/2022/dsa-5053
- https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html
- https://lists.debian.org/debian-lts-announce/2024/03/msg00021.html
- https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval
- https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security
- https://security.gentoo.org/glsa/202211-10
- https://www.debian.org/security/2022/dsa-5053
Get alerted when CVE-2022-22817 or the next vulnerability affects your stack