{"id":"CVE-2022-22817","aliases":["CVE-2022-22817","GHSA-8vj2-vxx3-667w","BIT-PILLOW-2022-22817","PYSEC-2022-10"],"related":[],"kind":"vulnerability","state":"published","title":"Arbitrary expression injection in Pillow","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"`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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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,","source":"nvd"},{"lang":"en","text":"PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method.","format":"markdown","source":"pysec"}],"published":"2022-01-07T00:00:00.000Z","modified":"2026-09-08T08:48:18.421Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-74"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"9.0.1"}],"ecosystem":"PyPI","package":"pillow","purl":"pkg:pypi/pillow","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"9.0.1"}],"vendor":"python","product":"pillow","cpe":"cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"9.0"},{"status":"affected","version":"10.0"},{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"9.0.0"}],"ecosystem":"PyPI","package":"pillow","purl":"pkg:pypi/pillow","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"9.0.1"}],"ecosystem":"Bitnami","package":"pillow","purl":"pkg:bitnami/pillow","source":"bitnami"}],"references":[{"url":"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval","tags":["advisory","release-notes","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html","tags":["advisory","mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://www.debian.org/security/2022/dsa-5053","tags":["advisory","third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security","tags":["advisory","release-notes","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://security.gentoo.org/glsa/202211-10","tags":["advisory","third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/03/msg00021.html","tags":["mailing-list","web","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-22817","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-8vj2-vxx3-667w","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/pillow/PYSEC-2022-10.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/python-pillow/Pillow","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2024-10-15T17:36:26.542Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-22817","url":"https://www.cve.org/CVERecord?id=CVE-2022-22817","licence":"CVE Terms of Use","modified":"2024-10-15T20:26:11.440Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8vj2-vxx3-667w","url":"https://github.com/advisories/GHSA-8vj2-vxx3-667w","licence":"CC-BY-4.0","modified":"2024-10-14T18:26:08.636Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-22817","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-22817","licence":"Public domain","modified":"2026-06-17T04:29:05.480Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-10","url":"https://osv.dev/vulnerability/PYSEC-2022-10","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:58.166Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-PILLOW-2022-22817","url":"https://osv.dev/vulnerability/BIT-PILLOW-2022-22817","licence":"Apache-2.0","modified":"2026-09-08T08:48:18.421Z"}],"updatedAt":"2026-11-25T22:58:09.156Z","epss":{"score":0.03684,"percentile":0.89975,"date":"2026-12-01T12:00:22.000Z"}}