Inefficient Algorithmic Complexity in Pillow - CVE-2026-96640
Published: November 19, 2026
Vulnerability details
The vulnerability allows a remote attacker to cause a denial of service by exhausting CPU resources.
The vulnerability exists due to inefficient algorithmic complexity in Pillow's PDF page-tree traversal, which processes shared page-tree nodes repeatedly when appending an image to an existing PDF. A remote attacker can supply a malformed PDF to an application that uses Pillow to append an image to the file, causing excessive CPU consumption during page-tree traversal and rewriting.
Affected software
Anolis OS
Ubuntu
python3-pil (Ubuntu package)
python-pil (Ubuntu package)
python3-pillow
python3-pillow-devel
python3-pillow-tk
python3-pillow-doc
python3-pillow-qt
How to mitigate CVE-2026-96640
python3-pil (Ubuntu package) - addressed in versions 5.1.0-1ubuntu0.8+esm3, 7.0.0-4ubuntu0.9+esm2, 9.0.1-1ubuntu0.7, 10.2.0-1ubuntu1.5, 12.1.1-2ubuntu1.5, 12.3.0-1ubuntu2
python-pil (Ubuntu package) - update to 5.1.0-1ubuntu0.8+esm3
python3-pillow - addressed in versions 5.1.1-33, 13.0.0-1
python3-pillow-devel - addressed in versions 5.1.1-33, 13.0.0-1
python3-pillow-tk - addressed in versions 5.1.1-33, 13.0.0-1
python3-pillow-doc - addressed in versions 5.1.1-33, 13.0.0-1
python3-pillow-qt - update to 13.0.0-1