Vulnerabilities

Security fix · CVE-2026-112894

Pillow is a Python imaging library.

Published Oct 19, 2026 · catalog updated Oct 26, 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-112894. 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
Bitnami pillow · PyPI pillow · pip Pillow

Pillow's PDF writer takes time proportional to the square of the number of frames when it saves a multi-frame image as a multi-page PDF. Anyone who can get an application to convert their uploaded image this way can tie up a worker at full CPU for minutes with a small file. A 240 KB animated image takes about 70 seconds, a 720 KB one an estimated 10 minutes, and a 125-byte animated PNG that merely *declares* a large frame count triggers the same slowdown with no upper bound short of 2³¹ frames. Memory stays under 100 MB and the decompression-bomb limit never applies. The cause is in , which finds the next free id by computing . rebuilds three sets over every id reserved so far on each call. calls it three times (four for palette images with transparency) per frame, for frames, before any page is written. That makes the id-reservation loop alone O(N²). Because is taken from the file before any frame is seeked, APNG's count drives the loop even when the frames don't exist. In that case the save raises only after the full delay. The precondition is that the application calls on the attacker's file; and alone do not reach this code. The attached reproducer shows 4× the frames costing about 11× the CPU for a valid GIF and about 16× for a fixed 125-byte APNG. The behaviour was introduced in (2018-01-18) and first shipped in Pillow 5.1.0. A small patch that tracks the highest id in makes the save linear. ## Details Saving a multi-frame image as a multi-page PDF ( ) costs CPU time proportional to the square of the frame count, independent of pixel content, because every object id the PDF writer reserves is found by rebuilding and scanning the set of all ids reserved so far. A 1×1-pixel animated GIF made of N identical 15-byte frames (built by the reproducer) gives, on a 2-CPU container with the stock build at this commit (absolute timings vary by machine; the growth rate does not): | frames | GIF size | | peak RSS | |---|---|---|---| | 2 000 | 30 KB | 1.1 s | | | 8 000 | 12

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.

  • Bitnami pillow5.1.0 → 13.0.0
  • PyPI pillow5.1.0 → 13.0.0
  • pip Pillow>= 5.1.0, < 13.0.0

How to fix CVE-2026-112894

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-112894. 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 >= 5.1.0, < 13.0.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-407. 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. From 5.1.0 until 13.0.0, Pillow takes quadratic time to reserve PDF object identifiers when saving many frames with save_all enabled. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object. An attacker can supply a multi-frame image, including a small APNG with a large declared frame count, to an application

  2. Oct 20, 2026 · NIST NVD

    Updated

    Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow takes quadratic time to reserve PDF object identifiers when saving many frames with save_all enabled. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object. An attacker can supply a multi-frame image, including a small APNG with a large declared frame count, to an application

  3. Oct 20, 2026 · NIST NVD

    Updated

    Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow takes quadratic time to reserve PDF object identifiers when saving many frames with save_all enabled. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object. An attacker can supply a multi-frame image, including a small APNG with a large declared frame count, to an application

  4. Oct 21, 2026 · GitHub Advisory Database

    Updated

    Pillow's PDF writer takes time proportional to the square of the number of frames when it saves a multi-frame image as a multi-page PDF. Anyone who can get an application to convert their uploaded image this way can tie up a worker at full CPU for minutes with a small file. A 240 KB animated image takes about 70 seconds, a 720 KB one an estimated 10 minutes, and a 125-byte animated PNG that merely

  5. Oct 26, 2026 · GitHub Advisory Database

    Fix available

    pillow fixed in 13.0.0

  6. Oct 26, 2026 · GitHub Advisory Database

    Fix available

    pillow fixed in 13.0.0

  7. Oct 26, 2026 · GitHub Advisory Database

    Updated

    Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow takes quadratic time to reserve PDF object identifiers when saving many frames with save_all enabled. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object. An attacker can supply a multi-frame image, including a small APNG with a large declared frame count, to an application

Sources

  • CVE.orgVulnerability recordCVE-2026-112894

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-112894

    30-day exploitation probability 0.59%

    first.org
  • GitHub Advisory DatabasePackage advisoryGHSA-jg86-v3jv-hrpm

    GitHub Advisory Database record mirrored by OSV.

    github.com
  • NIST NVDVulnerability recordCVE-2026-112894

    Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow takes quadratic time to reserve PDF object identifiers when saving many frames with save_all enabled. PdfParser.next_object_id() repeatedly rebuilds and scans all previously reserved identifiers for every object.

    nvd.nist.gov
  • OpenSSF OSV / OSV ScannerPackage advisoryBIT-pillow-2026-112894

    Pillow: Quadratic-time DoS in PDF save_all (PdfParser.next_object_id)

    osv.dev
  • PyPA Advisory DatabasePackage advisoryGHSA-jg86-v3jv-hrpm

    Pillow: Quadratic-time DoS in PDF save_all (PdfParser.next_object_id)

    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 26, 2026
  • GitHub Advisory DatabaseOct 26, 2026
  • OpenSSF OSV / OSV ScannerOct 26, 2026
  • CVE.orgOct 21, 2026
  • NIST NVDOct 21, 2026