PyPI
CVE-2026-128067
Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size
- Severity
- High
- Published
- 12 Nov 2026
- Last changed
- 12 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 13.0.0
- Exploit chance
- 0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Out-of-bounds write (CWE-787)
- Also known as
- GHSA-xcvg-w56q-r89m
- Sources
- OSV.dev and GitHub
Description
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).
Affected software
| Software | Affected versions |
|---|---|
pillowPyPI · osv:PyPI:pillow |
|
About pillow
- Weekly downloads (PyPI)
- 162,458,184PyPI Stats, 24 Nov 2026
Vulnerabilities in pillow
- In our list
- 2
- Published in the last 12 months
- 2
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-128066Pillow: Memory DoS in TIFF and EXIF IFD parsing via overlapping tag dataMedium 12 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-128067
- GitHub Advisory Database https://github.com/advisories/GHSA-xcvg-w56q-r89m