HIGHCVSS v4 8.4Vulnerability

CVE-2026-128067

``` ============================================================================ ANT-2026-CS7N494P [high] CWE-787 memory-safety Heap buffer overflow saving TIFF with libtiff when tags override image size Location: src/libImaging/TiffDecode.c:1035 in ImagingLibTiffEncode() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ ``` When Pillow saves an image as a compressed TIFF, size information taken from the image's metadata can make the encoder read past the end of a heap buffer. Someone who uploads an image can use this to get the server process's memory, including pointers, copied into the saved file, or to crash the process. When the metadata also enables TIFF "Predictor=2" compression, the encoder writes past the buffer instead, corrupting the heap and aborting the process. This affects applications that write TIFF through libtiff (any `compression=` other than raw) and either carry the source metadata across with `exif=im.getexif()` / `tiffinfo=`, or simply re-save a crafted palette TIFF with `Image.open(f).save(out, "TIFF")`, which inherits its compression and predictor from the upload. In `TiffImagePlugin._save`'s libtiff branch, only `BitsPerSample` is pinned to the real image when the tag list for the encoder is built (`src/PIL/TiffImagePlugin.py:1955`). `ImageWidth`, `ImageLength` and `PlanarConfiguration` are set from `im.size` but are then overwritten by the `exif=`/`tiffinfo=` merge loop at `:1768-1772`. `SamplesPerPixel` is never set for single-band modes, so a value from the caller's tags or from the source TIFF's own IFD reaches `TIFFSetField`. `ImagingLibTiffEncode` then passes a row buffer sized from the actual image (`src/encode.c:291`) to `TIFFWriteScanline` (`src/libImaging/TiffDecode.c:1035`) with no check against `TIFFScanlineSize()`, and libtiff consumes a full scanline of the tag-described width from it. The attached reproducer demonstrates the read case. A 64x

Properties

Summary
Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size
Severity
high
Nvd fetched at
2026-11-14T00:40:25.638091+00:00
Epss score
0.00451
Cvss severity
HIGH
Cvss score
8.4
Retrieved at
2026-11-14T00:51:03+00:00
Ghsa published
2026-11-12T23:34:43Z
Source url
https://github.com/advisories/GHSA-xcvg-w56q-r89m
Ghsa updated
2026-11-12T23:34:44Z
Ghsa id
GHSA-xcvg-w56q-r89m
Last source
FIRST EPSS
Score
8.4
Cvss version
4.0
Cve id
CVE-2026-128067
Cvss vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
First seen by Signal
2026-11-13T00:03:27+00:00
Name
CVE-2026-128067
Is ghsa only
false
Vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Related Entities (3)

AFFECTS (1)

→[Software]pip/Pillow

HAS_WEAKNESS (1)

→[Weakness]Out-of-bounds Write

VULNERABLE_TO (1)

←[Software]pip/Pillow

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-128067 (CVSS v4 8.4) — Ninja Signal Threat Intelligence | Ninja Signal