The vulnerability allows for a Denial of Service through memory exhaustion or an endless loop when processing a malicious PDF file. The root cause is the lack of protection against cyclical object references within the PDF structure. The analysis of the commits patching this vulnerability (from version 2.6.6 to 2.6.7) reveals two primary vulnerable functions:
-
setasign\Fpdi\PdfParser\CrossReference\CrossReference::__construct: This function is responsible for parsing the cross-reference table of a PDF. The vulnerability existed because the code did not check for circular dependencies in the /Prev chain of the cross-reference table. An attacker could craft a PDF where this chain creates an infinite loop, causing the constructor to continuously try to parse the same data, leading to resource exhaustion. The patch adds a tracking mechanism for visited table offsets to detect and prevent such loops.
-
setasign\Fpdi\PdfReader\Page::getAttribute: This function retrieves attributes for a PDF page, including those inherited from parent pages. The vulnerability was in the logic that traverses the page tree upwards via the /Parent reference. A malicious PDF could define a page hierarchy with a circular reference (e.g., a child page listing an ancestor as its parent). When getAttribute would try to resolve an inherited attribute, it would enter an infinite loop traversing this circular page tree. The patch resolves this by introducing recursion detection during the object resolution process.
Both functions are core to the PDF parsing process in FPDI and would be present in a runtime profile when a malicious file triggers the vulnerability.