CVE-2022-22817 json
Arbitrary expression injection in Pillow
published 2022-01-07 4 y ago modified 2026-09-08 2 mo ago also BIT-pillow-2022-22817 , EUVD-2022-0195 , GHSA-8vj2-vxx3-667w , PYSEC-2022-10
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 3.6%
- EPSS 3.6% chance of exploitation in 30 days, percentile 89%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi pillow 9.0.0, 9.0.1
- bitnami pillow 9.0.1
- python pillow 9.0.1
- pillow Debian 14, Debian 13, Debian 12 9.0.0-1
debian advisories DEBIAN-CVE-2022-22817
- pillow Ubuntu 18.04 LTS 5.1.0-1ubuntu0.8
- pillow Ubuntu 20.04 LTS 7.0.0-4ubuntu0.6
ubuntu advisories UBUNTU-CVE-2022-22817
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-pillow RHEL 7 2.0.0-23.gitd1c6db8.el7_9
- python-pillow-qt RHEL 7 2.0.0-23.gitd1c6db8.el7_9
- python-pillow-tk RHEL 7 2.0.0-23.gitd1c6db8.el7_9
- python-pillow-sane RHEL 7 2.0.0-23.gitd1c6db8.el7_9
- python-pillow RHEL 8 5.1.1-18.el8_5
- python3-pillow RHEL 8 5.1.1-18.el8_5
- python3-pillow-tk RHEL 8 5.1.1-18.el8_5
- python-pillow RHEL 8.1 E4S 5.1.1-13.el8_1
red hat advisories RHSA-2022:0669RHSA-2022:0667RHSA-2022:0665RHSA-2022:0609RHSA-2022:0643
- python-Pillow OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 4.2.1-3.26.1
- grafana OpenStack Cloud Crowbar 9, OpenStack Cloud 9 6.7.4-3.26.1
- python-lxml OpenStack Cloud Crowbar 9, OpenStack Cloud 9 4.2.4-3.3.1
- python-Pillow OpenStack Cloud Crowbar 9, OpenStack Cloud 9 5.2.0-3.17.1
- ardana-barbican OpenStack Cloud 9 9.0+git.1644879908.8a641c1-3.13.1
- rubygem-sinatra OpenStack Cloud Crowbar 9 1.4.6-4.3.1
- openstack-cinder OpenStack Cloud Crowbar 9, OpenStack Cloud 9 13.0.10~dev24-3.34.2
- openstack-ironic OpenStack Cloud Crowbar 9, OpenStack Cloud 9 11.1.5~dev18-3.28.2
suse advisories SUSE-SU-2024:0290-1SUSE-SU-2022:1729-1
- python-Pillow openSUSE Tumbleweed 11.1.0-1.1
- python-Pillow openSUSE Tumbleweed 9.0.1-1.1
opensuse advisories openSUSE-SU-2025:14645-1openSUSE-SU-2024:11814-1
- python3-pillow AlmaLinux 8 5.1.1-18.el8_5
- python3-pillow-tk AlmaLinux 8 5.1.1-18.el8_5
almalinux advisories ALSA-2022:0643
- python-pillow Rocky Linux 8 5.1.1-18.el8_5
rocky linux advisories RLSA-2022:0643
- py3-pillow Alpine 3.15 8.4.0-r3
- py3-pillow Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 9.0.1-r0
alpine advisories ALPINE-CVE-2022-22817
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-22817 updated cvss 9.8
python-pillow: PIL.ImageMath.eval allows evaluation of arbitrary expressions
-
Red Hat Quay 3 quay/quay-rhel8affected: no fix available
-
Red Hat CodeReady Linux Builder (v. 8) python3-pillow 5.1.1-18.el8_5, python3-pillow-tk 5.1.1-18.el8_5 Red Hat Enterprise Linux AppStream (v. 8) python-pillow 5.1.1-18.el8_5, python3-pillow 5.1.1-18.el8_5fixed: vendor fix RHSA-2022:0643
-
Red Hat Enterprise Linux AppStream E4S (v. 8.1) python-pillow 5.1.1-13.el8_1, python3-pillow 5.1.1-13.el8_1fixed: vendor fix RHSA-2022:0669
-
Red Hat Enterprise Linux AppStream EUS (v. 8.2) python-pillow 5.1.1-14.el8_2, python3-pillow 5.1.1-14.el8_2fixed: vendor fix RHSA-2022:0667
-
Red Hat Enterprise Linux AppStream EUS (v.8.4) python-pillow 5.1.1-14.el8_4, python3-pillow 5.1.1-14.el8_4fixed: vendor fix RHSA-2022:0665
-
Red Hat Enterprise Linux Client (v. 7) python-pillow 2.0.0-23.gitd1c6db8.el7_9 Red Hat Enterprise Linux Client Optional (v. 7) python-pillow 2.0.0-23.gitd1c6db8.el7_9, python-pillow-qt 2.0.0-23.gitd1c6db8.el7_9, python-pillow-tk 2.0.0-23.gitd1c6db8.el7_9, python-pillow-sane 2.0.0-23.gitd1c6db8.el7_9 Red Hat Enterprise Linux ComputeNode Optional (v. 7) python-pillow 2.0.0-23.gitd1c6db8.el7_9, python-pillow-qt 2.0.0-23.gitd1c6db8.el7_9, python-pillow-tk 2.0.0-23.gitd1c6db8.el7_9, python-pillow-sane 2.0.0-23.gitd1c6db8.el7_9 Red Hat Enterprise Linux Server (v. 7) python-pillow 2.0.0-23.gitd1c6db8.el7_9 Red Hat Enterprise Linux Server Optional (v. 7) python-pillow 2.0.0-23.gitd1c6db8.el7_9, python-pillow-qt 2.0.0-23.gitd1c6db8.el7_9, python-pillow-tk 2.0.0-23.gitd1c6db8.el7_9, python-pillow-sane 2.0.0-23.gitd1c6db8.el7_9 Red Hat Enterprise Linux Workstation (v. 7) python-pillow 2.0.0-23.gitd1c6db8.el7_9fixed: vendor fix RHSA-2022:0609
+1 more productsfewer
Red Hat Enterprise Linux Workstation Optional (v. 7) python-pillow 2.0.0-23.gitd1c6db8.el7_9, python-pillow-qt 2.0.0-23.gitd1c6db8.el7_9, python-pillow-tk 2.0.0-23.gitd1c6db8.el7_9, python-pillow-sane 2.0.0-23.gitd1c6db8.el7_9
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
3.58% chance of exploitation in the next 30 days, higher than 89% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | pillow | <9.0.1 <9.0.0 |
9.0.1 9.0.0 |
| bitnami | pillow | <9.0.1 |
9.0.1 |
Classification
- Weakness
-
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component
References
-
github.com
/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11
web
-
debian.org
/security/2022/dsa-5053
vendor-advisory, web, third-party-advisory, advisory
-
security.gentoo.org
/glsa/202211-10
vendor-advisory, web, third-party-advisory, advisory
-
pillow.readthedocs.io
/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval
web, release-notes, vendor-advisory, advisory
-
pillow.readthedocs.io
/en/stable/releasenotes/9.0.1.html#security
web, release-notes, vendor-advisory, advisory
-
lists.debian.org
/debian-lts-announce/2022/01/msg00018.html
mailing-list, web, third-party-advisory, advisory
-
lists.debian.org
/debian-lts-announce/2024/03/msg00021.html
mailing-list, web
-
nvd.nist.gov
/vuln/detail/CVE-2022-22817
advisory, web
-
github.com
/advisories/GHSA-8vj2-vxx3-667w
advisory
-
github.com
/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-10.yaml
web
-
github.com
/python-pillow/Pillow
package
Sources
- CVE List CVE-2022-22817
- GitHub Advisory GHSA-8vj2-vxx3-667w
- NVD CVE-2022-22817
- OSV BIT-pillow-2022-22817
- OSV PYSEC-2022-10
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.