{"id":"CVE-2026-128067","summary":"Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size","details":"Pillow is a Python imaging library. From 2.3.0 through 12.3.0, Pillow applications that save compressed TIFF images through libtiff can pass attacker-controlled image geometry tags to the encoder while allocating its row buffer from the actual image dimensions. The affected TiffImagePlugin._save path allows ImageWidth, ImageLength, or SamplesPerPixel from exif=, tiffinfo=, or a source TIFF IFD to make libtiff consume a larger scanline than the buffer supplied by ImagingLibTiffEncode. This can read heap memory into the generated TIFF or crash the process. When TIFF Predictor 2 is enabled, libtiff can rewrite the oversized scanline in place and corrupt memory beyond the buffer. A carried-over PlanarConfiguration value of 2 instead makes libtiff use a shorter scanline and can produce an undecodable output file, but is not established to cause the out-of-bounds access. This issue is fixed in version 13.0.0.","aliases":["GHSA-xcvg-w56q-r89m"],"modified":"2026-11-13T13:10:14.978818375Z","published":"2026-11-12T22:49:58.221Z","database_specific":{"cwe_ids":["CWE-787"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/128xxx/CVE-2026-128067.json","cna_assigner":"GitHub_M"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/128xxx/CVE-2026-128067.json"},{"type":"FIX","url":"https://github.com/python-pillow/Pillow/commit/53318b50e8e9e85a57d033d4d879e1398d97aeb1"},{"type":"FIX","url":"https://github.com/python-pillow/Pillow/commit/ec5f1cbcf67275641abaad5c065ffb64a0a804a9"},{"type":"WEB","url":"https://github.com/python-pillow/Pillow/releases/tag/13.0.0"},{"type":"ADVISORY","url":"https://github.com/python-pillow/Pillow/security/advisories/GHSA-xcvg-w56q-r89m"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-128067"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/python-pillow/pillow","events":[{"introduced":"b1b88cf4d255c4b9faf1dae05faaa78091268cb1"},{"fixed":"293218ad059d994baf1777d882911bed6a49704a"},{"fixed":"53318b50e8e9e85a57d033d4d879e1398d97aeb1"},{"fixed":"ec5f1cbcf67275641abaad5c065ffb64a0a804a9"}],"database_specific":{"extracted_events":[{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"2.3.0"},{"fixed":"13.0.0"}]},{"range":[{"fixed":"53318b50e8e9e85a57d033d4d879e1398d97aeb1"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_COMMIT","range":[{"fixed":"ec5f1cbcf67275641abaad5c065ffb64a0a804a9"}]},{"original_tag":"13.0.0","range":[{"fixed":"293218ad059d994baf1777d882911bed6a49704a"}],"source":"REFERENCES_TAG"}]}}],"versions":["12.3.0","12.2.0","12.1.0","12.0.0","11.3.0","11.2.1","11.1.0","11.0.0","10.4.0","10.3.0","10.2.0","10.1.0","10.0.0","9.5.0","9.4.0","9.3.0","9.2.0","9.1.0","9.0.0","8.4.0","8.3.0","8.2.0","8.1.0","8.0.0","7.2.0","7.1.0","7.0.0","6.2.0","6.1.0","6.0.0","5.4.0","5.3.0","5.2.0","5.1.0","5.0.0","4.3.0","4.2.0","4.1.0","4.0.0","4.0.0a","3.4.0","3.3.0","3.2.0","3.1.0","3.1.0-rc1","2.9.0","2.9.0.dev2","2.9.0.dev1","2.9.0.dev0","2.8.1","2.8.0","2.7.0","2.5.0","2.3.0"],"database_specific":{"vanir_signatures":[{"target":{"file":"src/libImaging/TiffDecode.c","function":"ImagingLibTiffEncode"},"deprecated":false,"digest":{"length":1000,"function_hash":"111594629840009715343409152504898600105"},"id":"CVE-2026-128067-b6dd9bfd","signature_type":"Function","signature_version":"v1","source":"https://github.com/python-pillow/pillow/commit/ec5f1cbcf67275641abaad5c065ffb64a0a804a9"},{"deprecated":false,"digest":{"line_hashes":["188967658685476293475612679463822553848","259117789613976754992331597665371384996","263655289590584502705193078764417061155","120938566522317082933488558068096884182"],"threshold":0.9},"id":"CVE-2026-128067-fb5cbd1b","signature_type":"Line","signature_version":"v1","source":"https://github.com/python-pillow/pillow/commit/ec5f1cbcf67275641abaad5c065ffb64a0a804a9","target":{"file":"src/libImaging/TiffDecode.c"}}],"vanir_signatures_modified":"2026-11-13T13:10:14Z","source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-128067.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:H/SC:N/SI:N/SA:N"}]}