The vulnerability lies in the FPDI PDF parser's handling of recursive data structures within a PDF file. Specifically, the setasign/fpdi library did not properly check for circular references in PDF objects, such as indirect object references and page dictionaries. An attacker could craft a small PDF file with such circular references, causing the parsing engine to enter an infinite loop. This infinite recursion would continuously consume memory, eventually leading to a memory exhaustion error (OOM) and crashing the application, resulting in a Denial of Service (DoS).
The patch addresses this issue by introducing checks to detect and prevent these infinite recursions. In PdfType::resolve, a list of ensured objects is now passed along during recursion to detect if an object is being resolved again in the same chain. In PdfReader::getPage and PdfReader::readPages, a list of already read page kids is maintained to detect and prevent recursive page dictionary processing. The identified vulnerable functions are the entry points where this uncontrolled recursion was triggered.