PoDoFo 0.9.5 funciton PdfPagesTree::GetPageNodeFromArray in PdfPagesTree.cpp cause a denial of service.
Analyzer
code from https://sourceforge.net/p/podofo/code/HEAD/tree/podofo/trunk/ (2017-04-09)
compile:
|
|
and run it:
|
|
Crash Info
|
|
analysis
in src/doc/PdfPagesTree.cpp:475
|
|
When use podofotxtextract to extract txt info from a PDF file, and when the argument rKidsArray is a cycle linked list, this function will in an endless loop. When rKidsArray[0].GetReference()->GetDictionary().GetKey(“Kids”) is an array which the first element is the argument rKidsArray itselt, in line 506 the var = rKidsArray[0].GetReference()->GetDictionary().GetKey(“Kids”) and in the next while loop, it will enter line 481, which will recursion call GetPageNodeFromArray. Then each 2 times call GetPageNodeFromArray it will goto the same state.