CVE-2022-22817
CRITICAL9.8EPSS 2.8%Arbitrary expression injection in Pillow
Published: 1/12/2022Modified: 4/28/2026
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 packages (5)
- Alpine/py3-pillowfrom 0, < 8.4.0-r3
- Bitnami/pillowfrom 0, < 9.0.1
- Debian/pillowfrom 0, < 8.1.2+dfsg-0.3+deb11u1
- PyPI/pillowfrom 0, < 9.0.1
- PyPI/pillowfrom 0, < 9.0.0
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 4.0 | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| osv | CVSS 3.1 | CRITICAL9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
References (13)
- ADVISORYhttps://github.com/advisories/GHSA-8vj2-vxx3-667w
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2022-22817
- ADVISORYhttps://security.alpinelinux.org/vuln/CVE-2022-22817
- ADVISORYhttps://security-tracker.debian.org/tracker/CVE-2022-22817
- PATCHhttps://github.com/python-pillow/Pillow
- WEBhttps://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-10.yaml
- WEBhttps://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11
- WEBhttps://lists.debian.org/debian-lts-announce/2022/01/msg00018.html
- WEBhttps://lists.debian.org/debian-lts-announce/2024/03/msg00021.html
- WEBhttps://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval
- WEBhttps://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security
- WEBhttps://security.gentoo.org/glsa/202211-10
- WEBhttps://www.debian.org/security/2022/dsa-5053