{"id":"CVE-2023-50447","kind":"vulnerability","aliases":["CVE-2023-50447","GHSA-3f63-hfp8-52jq"],"related":[],"title":"Arbitrary Code Execution in Pillow","description":"Pillow through 10.1.0 allows PIL.ImageMath.eval Arbitrary Code Execution via the environment parameter, a different vulnerability than CVE-2022-22817 (which was about the expression parameter).","summary":"Pillow's PIL.ImageMath.eval function accepts an environment parameter that can be abused to execute arbitrary Python code. An attacker who controls the input passed to that function can run code on the machine processing the image.","severity":"critical","cvss":8.1,"epss":0.01703,"exploited":false,"exploited_at":null,"products":[{"name":"Pillow","fixed":["10.2.0"],"affected":"< 10.2.0","ecosystem":"pypi"},{"name":"python pillow","fixed":[],"affected":"<= 10.1.0","ecosystem":"vendor"},{"name":"debian linux","fixed":[],"affected":"= 10.0","ecosystem":"vendor"},{"via":"cpe","name":"pillow","fixed":[],"affected":"<= 10.1.0","ecosystem":"pypi"}],"ecosystems":["pypi","vendor"],"tags":["cwe-94","cwe-95","image-processing","package","pillow","python"],"not_affected_if":["no-imagemath-eval","trusted-input-only"],"how_to_check":"- Check the installed Pillow version with `pip show pillow`\n- Search your code for calls to `ImageMath.eval` and see whether any argument comes from untrusted input\n- Review your lockfile or requirements for `pillow` pinned below `10.2.0`","fix":"- Pillow: upgrade to `10.2.0`","status":"open","published_at":"2024-01-19T20:15:11+00:00","first_seen_at":"2026-11-16T15:53:11+00:00","triaged_at":"2026-11-16T15:54:26+00:00","updated_at":"2026-11-16T16:08:50+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T15:54:26Z","model":"claude-haiku-5-5","output":{"fix":"- Pillow: upgrade to `10.2.0`","reach":"unknown","title":"Pillow: ImageMath.eval lets crafted input run arbitrary code","impact":"high","summary":"Pillow's PIL.ImageMath.eval function accepts an environment parameter that can be abused to execute arbitrary Python code. An attacker who controls the input passed to that function can run code on the machine processing the image.","audience":"developers","category":"package","nicknames":[],"who_cares":["python","pillow","image-processing"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"code runs on the server processing images","analyst_note":"","how_to_check":"- Check the installed Pillow version with `pip show pillow`\n- Search your code for calls to `ImageMath.eval` and see whether any argument comes from untrusted input\n- Review your lockfile or requirements for `pillow` pinned below `10.2.0`","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["no-imagemath-eval","trusted-input-only"],"who_is_affected":"Applications that import Pillow and call ImageMath.eval with data an outside party can influence are exposed. Services that only process images through standard Pillow APIs without ImageMath.eval are not directly affected by this flaw.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000703,"input_tokens":4578,"output_tokens":491,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2022':86C '-2023':7A,15A '-22817':87C '-50447':8A,16A '-94':24B '-95':26B '10.1.0':71C '3f63':11A '52jq':13A 'abus':44B 'accept':37B 'allow':72C 'arbitrari':1A,47B,74C 'attack':51B 'code':2A,49B,62B,75C 'control':53B 'cve':6A,14A,85C 'cwe':23B,25B 'debian':20A 'differ':82C 'environ':39B,79C 'execut':3A,46B,76C 'express':92C 'function':36B,59B 'ghsa':10A 'ghsa-3f63-hfp8-52jq':9A 'hfp8':12A 'imag':28B,68B 'image-process':27B 'input':55B 'linux':21A 'machin':65B 'packag':30B 'paramet':40B,80C,93C 'pass':56B 'pil.imagemath.eval':35B,73C 'pillow':5A,17A,19A,22A,31B,33B,69C 'process':29B,66B 'python':18A,32B,48B 'run':61B 'via':77C 'vulner':83C","nicknames":[],"mitigations":[],"who_affected":"Applications that import Pillow and call ImageMath.eval with data an outside party can influence are exposed. Services that only process images through standard Pillow APIs without ImageMath.eval are not directly affected by this flaw.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["debianlinux","linux","pillow","pythonpillow"],"ptokens":["debian","linux","pillow","python"],"labels":["critical","cwe94","cwe95","imageprocessing","package","pillow","pypi","python","vendor"],"campaign_type":null,"search_a":"'-2023':7A,15A '-50447':8A,16A '3f63':11A '52jq':13A 'arbitrari':1A 'code':2A 'cve':6A,14A 'debian':20A 'execut':3A 'ghsa':10A 'ghsa-3f63-hfp8-52jq':9A 'hfp8':12A 'linux':21A 'pillow':5A,17A,19A,22A 'python':18A","search_b":"'-94':24B '-95':26B 'abus':44B 'accept':37B 'arbitrari':47B 'attack':51B 'code':49B,62B 'control':53B 'cwe':23B,25B 'environ':39B 'execut':46B 'function':36B,59B 'imag':28B,68B 'image-process':27B 'input':55B 'machin':65B 'packag':30B 'paramet':40B 'pass':56B 'pil.imagemath.eval':35B 'pillow':31B,33B 'process':29B,66B 'python':32B,48B 'run':61B","search_c":"'-2022':86C '-22817':87C '10.1.0':71C 'allow':72C 'arbitrari':74C 'code':75C 'cve':85C 'differ':82C 'environ':79C 'execut':76C 'express':92C 'paramet':80C,93C 'pil.imagemath.eval':73C 'pillow':69C 'via':77C 'vulner':83C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2024-01-19T20:15:11+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-3f63-hfp8-52jq","url":"https://github.com/advisories/GHSA-3f63-hfp8-52jq","severity":"critical","published_at":"2024-01-19T21:30:35+00:00","modified_at":"2026-11-16T15:52:32+00:00","first_seen_at":"2026-11-16T15:53:11+00:00","fetched_at":"2026-11-16T15:56:53+00:00","note":null},{"source":"nvd","external_id":"CVE-2023-50447","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-50447","severity":null,"published_at":"2024-01-19T20:15:11+00:00","modified_at":"2026-06-17T06:39:39+00:00","first_seen_at":"2026-11-16T16:08:50+00:00","fetched_at":"2026-11-16T16:08:50+00:00","note":null}],"documents":[{"id":170806,"url":"https://github.com/python-pillow/Pillow/commit/45c726fd4daa63236a8f3653530f297dc87b160a","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":171086,"url":"http://www.openwall.com/lists/oss-security/2024/01/20/1","title":"Third-party advisory: www.openwall.com","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: www.openwall.com"},{"id":171087,"url":"https://devhub.checkmarx.com/cve-details/CVE-2023-50447/","title":"Third-party advisory: devhub.checkmarx.com","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: devhub.checkmarx.com"},{"id":171088,"url":"https://github.com/python-pillow/Pillow/releases","title":"Release notes: github.com","kind":"release","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release notes: github.com"},{"id":171089,"url":"https://lists.debian.org/debian-lts-announce/2024/01/msg00019.html","title":"Third-party advisory: lists.debian.org","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: lists.debian.org"}],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.01703,"url":"https://api.first.org/data/v1/epss?cve=CVE-2023-50447"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}