Infinite loop Affecting pillow package, versions [5.1.0,13.0.0)


Severity

Recommended
0.0
medium
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 IDSNYK-PYTHON-PILLOW-21277796
  • published20 Oct 2026
  • disclosed19 Oct 2026
  • creditNuno Lopes

Introduced: 19 Oct 2026

NewCVE-2026-112391  (opens in a new tab)
CWE-835  (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 Infinite loop via unbounded recursion in PdfParser.get_value and PdfParser.read_indirect in src/PIL/PdfParser.py. Both functions previously defaulted max_nesting to -1, meaning no nesting limit was enforced when parsing PDF structures. An attacker can supply a deeply nested PDF object to trigger unbounded recursion, exhausting the call stack and crashing the process.

CVSS Base Scores

version 4.0
version 3.1