An issue was discovered in Pillow before 8.1.1. The PDF parser allows a regular expression DoS (ReDoS) attack via a crafted PDF file because of a catastrophic backtracking regex.
https://security.gentoo.org/glsa/202107-33
https://pillow.readthedocs.io/en/stable/releasenotes/8.1.1.html