{"id":"CVE-2026-59197","published":"2026-07-14T16:25:23Z","modified":"2026-07-21T18:50:40Z","title":"Pillow: Heap out-of-bounds write in Pillow `ImageFilter.RankFilter` via integer overflow in `ImagingExpand`","vendor":"python-pillow","product":"Pillow","tier":"tail","description":{"text":"Pillow is a Python imaging library. Prior to 12.3.0, Pillow's public rank-filter API can trigger a native heap out-of-bounds write when given a very large odd filter size because ImageFilter.RankFilter.filter() calls image.expand(size // 2, size // 2) before rank-filter size validation and ImagingExpand() computes output dimensions with unchecked signed int arithmetic. This issue is fixed in version 12.3.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.2,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00582,"percentile":0.41762,"provenance":"source"},"cwes":[{"id":"CWE-787","name":"Out-of-bounds Write"},{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/python-pillow/Pillow/security/advisories/GHSA-xj96-63gp-2gmr","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/python-pillow/Pillow/pull/9695","tags":["x_refsource_MISC"]},{"url":"https://github.com/python-pillow/Pillow/commit/cce3bdb867c77a3420261ed1bfdb6b0787ec8fc1","tags":["x_refsource_MISC"]},{"url":"https://github.com/python-pillow/Pillow/releases/tag/12.3.0","tags":["x_refsource_MISC"]}],"priority":{"score":14.1,"factors":[{"name":"EPSS percentile","points":8.35},{"name":"CVSS severity","points":5.74}]},"vendorSlug":"python-pillow","affectedVersions":[{"vendor":"python-pillow","product":"Pillow","versions":["< 12.3.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-07-21T18:50:30.849980Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Pillow","vulnerableRanges":["<12.3.0"],"patched":["12.3.0"],"from":["GHSA-xj96-63gp-2gmr","PYSEC-2026-3454"],"provenance":"source"}],"summary":{"text":"The Pillow imaging library (python-pillow) contains a heap out-of-bounds write in its ImageFilter.RankFilter implementation, caused by unchecked integer arithmetic when the native ImagingExpand routine computes output dimensions for a very large odd filter size. An attacker who can supply a crafted filter size through the public rank-filter API can trigger the write over the network with no authentication or user interaction required, in configurations where Pillow applies RankFilter to input.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:38:31Z"},"euvd":{"id":"EUVD-2026-43734","exploited":false,"provenance":"source"}}