Vulnerabilities

Security fix · CVE-2026-112406

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-112406. EPSS is 0.57%. 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.57%
Remediation
Version ranges on file
Affected products
Bitnami pillow · PyPI pillow · pip Pillow · pypi pillow

A PDF file of a few hundred bytes makes Pillow hang forever, holding one processor core at 100%, when an application tries to append an image to it. Anyone who can supply the existing PDF to an application that calls (or ) can tie up that worker indefinitely. Memory use stays flat, so only an external timeout stops it. The bug is in in (the loop at line 505). For each original page, it walks the chain upward and stops only when it reaches a node with no . It keeps no record of nodes it has already visited, so a loop in that chain never ends. The simplest case is a root that lists itself as its own ; a longer cycle among page-tree nodes behaves the same way. The path is → → , and it is reached whether the save target is a file path or a . Plain pipelines are not affected, because Pillow only parses PDFs on the append path. This is a sibling of CVE-2026-42310 (the cyclic trailer loop in the same parser). The guard added to for that issue does not cover this walk. The loop was introduced in 24ecfe315ab5 (2018-03-03) and has been present in every release since 5.1.0. The attached reproducer builds two in-memory PDFs and appends a 4×4 image to each. The normal file finishes in about 45 ms. The 333-byte self-parented file is still spinning inside when a 5-second watchdog interrupts it. Two alternative fixes are attached: one silently tolerates the cycle, and one rejects the file with an error. ## Details walks the chain of every pre-existing page upward and stops only when a node has no . It keeps no record of visited nodes, so a page-tree node whose points at itself, or at any node below it, makes the walk spin forever. The following 333-byte file is a valid one-page PDF except that object 2, the page-tree root, declares : on these bytes never returns and holds one core at 100 % (the same happens when the target is a file path opened ). Interrupting it with after 5 s gives this traceback every time: The same file without on object 2 is appended to in ~30 ms. The loop: Ho

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
  • pypi pillowversion unspecified

How to fix CVE-2026-112406

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-112406. EPSS is 0.57%. 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-835: Infinite Loop. EPSS 0.57%. 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 can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF. This can hold the worker at full CPU and deny service. This issue is fixed in version 13.0

  2. Oct 20, 2026 · NIST NVD

    Updated

    Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF. This can hold the worker at full CPU and deny service. This issue is fixed in version 13.0

  3. Oct 20, 2026 · NIST NVD

    Updated

    Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF. This can hold the worker at full CPU and deny service. This issue is fixed in version 13.0

  4. Oct 21, 2026 · GitHub Advisory Database

    Updated

    A PDF file of a few hundred bytes makes Pillow hang forever, holding one processor core at 100%, when an application tries to append an image to it. Anyone who can supply the existing PDF to an application that calls (or ) can tie up that worker indefinitely. Memory use stays flat, so only an external timeout stops it. The bug is in in (the loop at line 505). For each original page, it walks the c

  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 can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that appends an image to that PDF. This can hold the worker at full CPU and deny service. This issue is fixed in version 13.0

Sources

  • CVE.orgVulnerability recordCVE-2026-112406

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-112406

    30-day exploitation probability 0.57%

    first.org
  • GitHub Advisory DatabasePackage advisoryGHSA-f2g6-542v-9j58

    GitHub Advisory Database record mirrored by OSV.

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

    ============================================================================ Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle Location: src/PIL/PdfParser.py:505 in PdfParser.rewrite_pages() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ A PDF file of a few hundred bytes makes Pillow hang forever, holdi

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

    Pillow is a Python imaging library. From 5.1.0 until 13.0.0, Pillow can enter an infinite loop while rewriting PDF pages. PdfParser.rewrite_pages() follows Parent relationships without detecting a cycle in the page tree. An attacker can supply a cyclic PDF to an application that

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

    Pillow: Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle

    osv.dev
  • PyPA Advisory DatabasePackage advisoryGHSA-f2g6-542v-9j58

    Pillow: Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle

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