Uncontrolled Recursion Affecting pillow package, versions [5.1.0,13.0.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.29% (21st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Uncontrolled Recursion vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-PILLOW-21277727
  • published20 Oct 2026
  • disclosed19 Oct 2026
  • creditJoshua Rogers

Introduced: 19 Oct 2026

NewCVE-2026-112895  (opens in a new tab)
CWE-674  (opens in a new tab)

How to fix?

Upgrade pillow to version 13.0.0 or higher.

Overview

Affected versions of this package are vulnerable to Uncontrolled Recursion via linearize_page_tree in src/PIL/PdfParser.py, where a PDF file containing a deeply nested page tree causes unbounded recursion that exhausts the call stack. An attacker can supply a malicious PDF with an arbitrarily deep /Pages tree hierarchy to crash the process.

CVSS Base Scores

version 4.0
version 3.1