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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| pillow (PyPI) | before 9.0.1, before 9.0.0 | GitHub Advisory Database, PyPA Advisory Database |
| python pillow | before 9.0.1 | NVD |
| debian debian_linux | 9.0, 10.0, 11.0 | NVD |
| pillow (Bitnami) | before 9.0.1 | Bitnami Vulnerability Database |
All scores
| CISA-ADP | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | critical 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 |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| Bitnami Vulnerability Database | critical rating |
Classification
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-eval | advisory, release-notes, vendor-advisory, web | |
| https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html | advisory, mailing-list, third-party-advisory, web | |
| https://www.debian.org/security/2022/dsa-5053 | advisory, third-party-advisory, vendor-advisory, web | |
| https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security | advisory, release-notes, vendor-advisory, web | |
| https://security.gentoo.org/glsa/202211-10 | advisory, third-party-advisory, vendor-advisory, web | |
| https://lists.debian.org/debian-lts-announce/2024/03/msg00021.html | mailing-list, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-22817 | advisory, web | |
| https://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11 | web | |
| https://github.com/advisories/GHSA-8vj2-vxx3-667w | advisory | |
| https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-10.yaml | web | |
| https://github.com/python-pillow/Pillow | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-22817 changed 2024-10-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8vj2-vxx3-667w changed 2024-10-14 | CC-BY-4.0 |
| NVD | CVE-2022-22817 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2022-10 changed 2023-12-06 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-PILLOW-2022-22817 changed 2026-09-08 | Apache-2.0 |