Skip to main content
Menu
CVEs

CVE

Pillow heap buffer overflow in TIFF save via libtiff

Affects Pillow 2.3.0 up to 13.0.0 when TIFF is saved through the libtiff encoder with tags that override image size. Fixed in Pillow 13.0.0.

CVE-2026-128067GHSA-XCVG-W56Q-R89MEUVD-2026-124778

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

8.4HighCNA
Exploited
No known exploitation
Fix
Fixed in 13.0.0
Who is exposed
Specific setups only

Do first: Check whether your setup matches what the bug needs. Pillow saves the image through the libtiff encoder (compression other than raw, or WRITE_LIBTIFF). Geometry tags come from exif=, tiffinfo=, or the source TIFF's own tags carried across the save. Re-saving a crafted palette TIFF without save arguments inherits its compression and predictor.

Published
Last modified
Reference
Last checked
0.45% · 39th percentile
40/100 · provisional
Specific setups only
None on Exploit-DB, Metasploit or GitHub

Summary

Pillow, a Python imaging library, has a heap buffer overflow when saving compressed TIFF images through libtiff. An attacker who can supply image geometry tags (ImageWidth, ImageLength, or SamplesPerPixel) through exif=, tiffinfo=, or a source TIFF can reach it over the network without logging in or any user action, and can read heap memory into the output file or crash the process, or with TIFF Predictor 2 enabled, corrupt memory beyond the buffer.

Read the original description

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.

cve.now Index

40Pcve.now Index 40 of 100 · methodology v3 · provisional
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure12/25Specific setups only, reachable over the network without a login
  • Reach20/20pillow: 177M downloads a week
  • Severity8.4/10CVSS 8.4
  • No patch0/5No signal

What would change the score

  • Would score about 90 if added to CISA KEV
  • Would score about 85 if CISA's SSVC rates exploitation active

Impact

  • Widely used

    pillow has 177m weekly downloads.Source: pypistats.org

    95.5k packages depend on pillow.Source: deps.dev

What to do

  • Check whether your setup matches what the bug needs.

    Pillow saves the image through the libtiff encoder (compression other than raw, or WRITE_LIBTIFF). Geometry tags come from exif=, tiffinfo=, or the source TIFF's own tags carried across the save. Re-saving a crafted palette TIFF without save arguments inherits its compression and predictor.
  • Upgrade to a fixed version: 13.0.0.

Check your systems with an agent

Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.

Check whether my systems are affected by CVE-2026-128067 (Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size), using the cve.now data below.

Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.

What cve.now has for CVE-2026-128067 (entry last updated 2026-11-12):
Affected:
- python-pillow Pillow: from 2.3.0, fixed in 13.0.0
- PyPI package pillow: fixed in 13.0.0
Fixed versions: 13.0.0.
Conditions (all must be true for the bug to be hit):
- Pillow saves the image through the libtiff encoder (compression other than raw, or WRITE_LIBTIFF). (source: https://github.com/python-pillow/Pillow/security/advisories/GHSA-xcvg-w56q-r89m)
- Geometry tags come from exif=, tiffinfo=, or the source TIFF's own tags carried across the save. (source: https://github.com/python-pillow/Pillow/security/advisories/GHSA-xcvg-w56q-r89m)
- Re-saving a crafted palette TIFF without save arguments inherits its compression and predictor. (source: https://github.com/python-pillow/Pillow/security/advisories/GHSA-xcvg-w56q-r89m)
Setup: the bug needs a feature or setting that is off by default or uncommon. Check whether each asset has it on.
Attacker needs: network access, no login, no user action.
CISA KEV: CVE-2026-128067 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-128067 only. If you also check another CVE, look up its own KEV status; never assume it from this one.

How to check:
- Packages (PyPI): find every lockfile in each project and run the stack.check operation of the cve.now MCP server (execute) on each one. Compare the resolved versions, not the ranges a manifest declares, with the affected versions above. Include transitive dependencies.

Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-xcvg-w56q-r89m
- https://github.com/python-pillow/Pillow/commit/53318b50e8e9e85a57d033d4d879e1398d97aeb1
- https://github.com/python-pillow/Pillow/commit/ec5f1cbcf67275641abaad5c065ffb64a0a804a9
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.

Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.

Entry: https://cve.now/CVE-2026-128067
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-128067"}.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • python-pillow Pillow

    From 2.3.0 · fixed in 13.0.0

  • pillowPyPI

    fixed in 13.0.0

    Fixed in 13.0.0 (released Oct 16, 2026, 27 days before disclosure).

    The latest release, 13.0.0, is not affected.

Evidence 6

Vendor advisory · 1

Establishes: Affected and fixed versions.

  1. Advisory

CVE record · 2

Establishes: The identifier and description.

  1. Record
  2. Record

Other links · 3

  1. Repository
  2. Repository
  3. Repository

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

Questions about CVE-2026-128067

Is CVE-2026-128067 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data

What does this mean?

Saving a TIFF with the libtiff encoder can overflow a heap buffer when tags override the image size. An attacker who uploads an image can read server process memory, including pointers, into the saved file, or crash the process. With Predictor=2, heap memory can be corrupted.Source: github.com

Which versions are affected by CVE-2026-128067?

Pillow: from 2.3.0 before 13.0.0. pillow (PyPI): before 13.0.0.Source: cve.now feed data

Am I affected, and how do I check?

Pillow versions from 2.3.0 up to, but not including, 13.0.0 are in the affected range. The setup matters: the save must use the libtiff encoder (any compression other than raw, or WRITE_LIBTIFF), and the geometry tags must come from exif=, tiffinfo=, or the source TIFF's own tags carried across the save. Re-saving a crafted palette TIFF without save arguments also inherits its compression and predictor. To check, run python -c "import PIL; print(PIL.__version__)" and review whether save calls pass compression, WRITE_LIBTIFF, exif=, or tiffinfo=.Source: github.com

How do I fix CVE-2026-128067?

Upgrade Pillow to 13.0.0 or later. The facts do not list vendor patch identifiers for this issue.Source: github.com