{"id":"CVE-2026-112396","published":"2026-10-19T21:02:15Z","modified":"2026-10-20T16:09:21Z","title":"Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer","vendor":"python-pillow","product":"Pillow","tier":"tail","description":{"text":"Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.9,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00694,"percentile":0.53863,"provenance":"source"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"references":[{"url":"https://github.com/python-pillow/Pillow/security/advisories/GHSA-4rr5-89j8-mwwm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/python-pillow/Pillow/commit/dc95da20207827a062cfbf551ee9f6031465a8bb","tags":["x_refsource_MISC"]},{"url":"https://github.com/python-pillow/Pillow/releases/tag/13.0.0","tags":["x_refsource_MISC"]}],"priority":{"score":14.9,"factors":[{"name":"EPSS percentile","points":10.77},{"name":"CVSS severity","points":4.13}]},"vendorSlug":"python-pillow","affectedVersions":[{"vendor":"python-pillow","product":"Pillow","versions":[">= 11.3.0, < 13.0.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-10-20T15:10:26.056158Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"pillow","vulnerableRanges":[">=11.3.0, <13.0.0"],"patched":["13.0.0"],"from":["GHSA-4rr5-89j8-mwwm","PYSEC-2026-4328"],"provenance":"source"}],"summary":{"text":"Pillow, the Python imaging library, contains a heap use-after-free in its TIFF encoding path, specifically in ImagingLibTiffEncode when writing to an in-memory buffer, in versions from 11.3.0 up to but not including 13.0.0. An attacker can exploit this by supplying TIFF tag values that libtiff rejects during encoding in an application that saves attacker-influenced TIFF data to BytesIO, which can crash the process and may enable code execution, requiring no authentication or user interaction but the application must be saving such attacker-controlled tags.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:41:00Z"},"euvd":{"id":"EUVD-2026-104632","exploited":false,"provenance":"source"}}