Vulnerabilities

Security fix · CVE-2026-112402

Pillow is a Python imaging library.

Published Oct 19, 2026 · catalog updated Oct 28, 2026 · Pillow is a Python

Last checked Oct 31, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2026-112402. EPSS is 0.59%. Act only if a listed version of Pillow is a Python is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (Pillow is a Python).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
High8.7
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.59%
Remediation
Version ranges on file
Affected products
PyPI pillow · pip Pillow · pypi pillow

There is a double free in Pillow's that crashes the process when an oversized transform runs out of memory. Instead of only raising , Pillow frees the output image's memory once while handling the error and then again when the Python object is cleaned up. Anyone who can choose the output size of can trigger it, but only on a worker with a memory limit (a common hardening for image workers) or a 32-bit process. The result is a crash of the worker, plus corruption of its heap that has not been shown to be controllable. The bug is in in (line 866). When its for the per-column lookup table of bytes fails, it calls . When the call comes from , is the struct owned by the live Python output object. in later runs on the freed struct again, writing its mutex and refcount in freed memory and freeing the pixel blocks a second time. The path is reached with , or with a pure scale/translate matrix, under the default NEAREST resampling. A very wide, 1-row output size makes the lookup table the allocation that fails while the image itself still fits. On 64-bit Linux with default overcommit, that requires an address-space limit such as , or . , and are not affected. The attached reproducer runs on a stock build with a 1 GB limit: raises and catches , then the process dies with SIGSEGV in called from . A memory-checking build reports the same path as a heap use-after-free. The faulty line was inherited from PIL 1.1.7 in the original fork commit, so every Pillow release since 1.0 is affected. A patch is attached. ## Details frees an image it does not own. On the one error path where its for the per-column lookup table fails, it calls . When reached through , is the struct held by a live Python object; that object's later calls on the already-freed struct and frees its pixel blocks a second time. Shortest demonstration on the stock build (the address-space limit stands in for / / on a worker): The 300 MB output image allocates; (1.2 GB) does not. is raised as intended, but the interpr

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • PyPI pillow0 → 13.0.0
  • pip Pillow<= 12.3.0
  • pypi pillowversion unspecified

How to fix CVE-2026-112402

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-112402. EPSS is 0.59%. Act only if a listed version of Pillow is a Python is installed.

Which versions are affected?

Compare what you have installed with Pillow <= 12.3.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-416: Use After Free. EPSS 0.59%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Technology hubs

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 19, 2026 · NIST NVD

    Detected

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after

  2. Oct 20, 2026 · NIST NVD

    Updated

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after

  3. Oct 21, 2026 · GitHub Advisory Database

    Updated

    There is a double free in Pillow's that crashes the process when an oversized transform runs out of memory. Instead of only raising , Pillow frees the output image's memory once while handling the error and then again when the Python object is cleaned up. Anyone who can choose the output size of can trigger it, but only on a worker with a memory limit (a common hardening for image workers) or a 32

  4. Oct 28, 2026 · PyPA Advisory Database

    Fix available

    pillow fixed in 13.0.0

  5. Oct 28, 2026 · PyPA Advisory Database

    Fix available

    pillow fixed in 13.0.0

  6. Oct 28, 2026 · PyPA Advisory Database

    Updated

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after

Sources

  • CVE.orgVulnerability recordCVE-2026-112402

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-112402

    30-day exploitation probability 0.59%

    first.org
  • GitHub Advisory DatabasePackage advisoryGHSA-7mwm-ghpf-9vrm

    Pillow: Double free in ImagingScaleAffine on calloc failure via Image.transform

    github.com
  • GitLab Advisory DatabasePackage advisoryCVE-2026-112402

    ============================================================================ Double free in ImagingScaleAffine on calloc failure via Image.transform Location: src/libImaging/Geometry.c:866 in ImagingScaleAffine() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ There is a double free in Pillow's Image.transform() that cra

    advisories.gitlab.com
  • NIST NVDVulnerability recordCVE-2026-112402

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEA

    nvd.nist.gov
  • PyPA Advisory DatabasePackage advisoryGHSA-7mwm-ghpf-9vrm

    Pillow: Double free in ImagingScaleAffine on calloc failure via Image.transform

    osv.dev
  • PyPA Advisory DatabasePackage advisoryPYSEC-2026-4331

    Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEA

    osv.dev

References

Freshness

Last verified in this catalog Oct 31, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • FIRST EPSSOct 31, 2026
  • PyPA Advisory DatabaseOct 28, 2026
  • PyPA Advisory DatabaseOct 28, 2026
  • GitLab Advisory DatabaseOct 23, 2026
  • GitHub Advisory DatabaseOct 22, 2026
  • CVE.orgOct 21, 2026
  • NIST NVDOct 21, 2026