A vulnerability in the Pillow Python imaging library versions 5.1.0 through 12.x allows a specially crafted PDF with malformed shared page-tree structures to cause resource exhaustion during PDF append operations. This occurs because the library treats the PDF /Pages graph as a tree without detecting duplicate references, leading to exponential expansion of page references and excessive CPU consumption. The issue is fixed in version 13.0.0.