{"id":"CVE-2022-22817","published":"2022-01-07T00:00:00Z","modified":"2024-10-15T20:26:11Z","title":"PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python…","vendor":null,"product":null,"tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.03584,"percentile":0.89687,"provenance":"source"},"cwes":[],"references":[{"url":"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html","tags":["mailing-list"]},{"url":"https://www.debian.org/security/2022/dsa-5053","tags":["vendor-advisory"]},{"url":"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security","tags":[]},{"url":"https://security.gentoo.org/glsa/202211-10","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/03/msg00021.html","tags":["mailing-list"]}],"priority":{"score":24.8,"factors":[{"name":"EPSS percentile","points":17.94},{"name":"CVSS severity","points":6.86}]},"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2024-10-15T17:36:26.542748Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"pillow","vulnerableRanges":["<9.0.1","<9.0.0"],"patched":["9.0.1","9.0.0"],"from":["GHSA-8vj2-vxx3-667w","PYSEC-2022-10"],"provenance":"source"}],"summary":{"text":"The flaw is in the PIL.ImageMath.eval function of the Pillow imaging library, affecting versions before 9.0.0, where expression evaluation is not restricted and arbitrary expressions, such as those using Python's exec method or a lambda expression, can be evaluated. An attacker who can supply the expression string to this function can run arbitrary code within the context of the application, with no authentication, user interaction, or special configuration required beyond reaching the vulnerable code path.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:34:49Z"},"euvd":{"id":"EUVD-2022-0195","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pillow-cve-2022-22817","children":[{"from":"CVE-2022-22817","to":"CVE-2023-50447","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/PIL/ImageMath.py"],"commits":["https://github.com/python-pillow/Pillow/commit/8531b01d6cdf0b70f256f93092caa2a5d91afc11","https://github.com/python-pillow/Pillow/commit/45c726fd4daa63236a8f3653530f297dc87b160a"],"basis":"shared function","functions":["eval"]}]}],"packageHistory":[{"cve":"CVE-2021-23437","published":"2021-09-03","fixed":"8.3.2","kev":false},{"cve":"CVE-2022-22815","published":"2022-01-07","fixed":"9.0.0","kev":false},{"cve":"CVE-2022-22816","published":"2022-01-07","fixed":"9.0.0","kev":false},{"cve":"CVE-2022-22817","published":"2022-01-07","fixed":"9.0.1","kev":false},{"cve":"CVE-2022-45198","published":"2022-11-14","fixed":"9.2.0","kev":false,"link":{"from":"CVE-2022-22817","to":"CVE-2022-45198","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:pillow","fromFixed":"9.0.1","toFixed":"9.2.0","daysApart":311}]}},{"cve":"CVE-2022-45199","published":"2022-11-14","fixed":"9.3.0","kev":false},{"cve":"CVE-2023-44271","published":"2023-11-03","fixed":"10.0.0","kev":false}],"package":"PyPI:pillow"}}