{"id":"CVE-2022-22817","aliases":["BIT-pillow-2022-22817","GHSA-8vj2-vxx3-667w","PYSEC-2022-10"],"url":"https://o3.security/vulnerability/CVE-2022-22817","summary":"Arbitrary expression injection in Pillow","details":"`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())\")`.\n\nWhile 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.","published":"2022-01-07T00:00:00Z","modified":"2026-10-08T02:45:32.364209688Z","cvss":{"score":9.8,"severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"pillow","fixedVersion":"9.0.1"}],"fix":{"url":"https://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11","label":"python-pillow/Pillow@8531b01"},"references":[{"type":"WEB","url":"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval"},{"type":"WEB","url":"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/22xxx/CVE-2022-22817.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-22817"},{"type":"ADVISORY","url":"https://security.gentoo.org/glsa/202211-10"},{"type":"ADVISORY","url":"https://www.debian.org/security/2022/dsa-5053"},{"type":"ARTICLE","url":"https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html"},{"type":"ARTICLE","url":"https://lists.debian.org/debian-lts-announce/2024/03/msg00021.html"},{"type":"WEB","url":"https://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-8vj2-vxx3-667w"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-10.yaml"},{"type":"PACKAGE","url":"https://github.com/python-pillow/Pillow"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-08T02:45:32.364209688Z"}}