You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bundled libtiff 4.7.1 is vulnerable to CVE-2026-4775 (integer overflow in putcontig8bitYCbCr44tile) #9579
Pillow 12.1.1 and 12.2.0 bundle libtiff 4.7.1 in pillow.libs/, which contains the vulnerable code from CVE-2026-4775 — a signed integer overflow in putcontig8bitYCbCr44tile (and related functions) in tif_getimage.c that can cause an out-of-bounds heap write via a specially crafted TIFF file, potentially resulting in denial of service or arbitrary code execution.
Proof
1. Pillow bundles its own libtiff and ignores the system library
The upstream fix is commit 782a11d6, authored February 22, 2026 — after 4.7.1 shipped. The Debian security team also describes their fix as a "backport", confirming it was not present in upstream 4.7.1.
The fix changes int32_t to const tmsize_t with explicit casts to prevent overflow:
Any application using Pillow to open untrusted TIFF files is exposed. Image.open() on a crafted TIFF file triggers the vulnerable code path in the bundled libtiff. Upgrading the system libtiff package does not help — Pillow loads its own copy from pillow.libs/ regardless.
Suggested Fix
Update the vendored libtiff to a commit that includes 782a11d6 (i.e., post-4.7.1 main branch), or apply the three-line patch to the vendored copy before the next wheel build.
Good question, and I looked into this more carefully. Pillow doesn't vendor libtiff source — the wheel build downloads a release tarball from download.osgeo.org using the version pinned in .github/dependencies.json, which is currently "tiff": "4.7.1". So the fix does depend on libtiff tagging a new release. Without that, options would be to apply the patch on top of the downloaded tarball during the build, or switch to building from a git snapshot. Apologies for the imprecision in my earlier description.
Activity
radarhere commentedon Apr 21, 2026
If this is a high severity problem, then do you know why libtiff hasn't released a new version to address it?
smallbrian commentedon Apr 21, 2026
Good question, and I looked into this more carefully. Pillow doesn't vendor libtiff source — the wheel build downloads a release tarball from download.osgeo.org using the version pinned in
.github/dependencies.json, which is currently"tiff": "4.7.1". So the fix does depend on libtiff tagging a new release. Without that, options would be to apply the patch on top of the downloaded tarball during the build, or switch to building from a git snapshot. Apologies for the imprecision in my earlier description.smallbrian commentedon Apr 21, 2026
I submitted an issue on their side: https://gitlab.com/libtiff/libtiff/-/work_items/825
radarhere commentedon Jun 1, 2026
After their response that we should patch it ourselves, I've created #9646
radarhere commentedon Jul 7, 2026
libtiff 4.7.2 has now been released.
radarhere commentedon Aug 7, 2026
#9839 has upgraded our version of libtiff to 4.7.2.