Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4193

StackOverflow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.13
    • 2.0.14, 3.0.0 PDFBox
    • Parsing, PDModel
    • None

    Description

      As part of a fuzzing run with the AFL-based Kelinci fuzzer found at https://github.com/isstac/kelinci for a larger software that uses PDFBox I found the following StackOverflowError issues:

      Exception in thread "main" java.lang.StackOverflowError
          at java.util.HashMap.hash(HashMap.java:338)
          at java.util.LinkedHashMap.get(LinkedHashMap.java:440)
          at org.apache.pdfbox.cos.COSDictionary.getDictionaryObject(COSDictionary.java:188)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2207)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)
          [...]
          at org.apache.pdfbox.pdfparser.COSParser.checkPagesDictionary(COSParser.java:2230)

      Additionally, a second StackOverflowError was found:

      Exception in thread "main" java.lang.StackOverflowError
          at java.util.HashMap.hash(HashMap.java:338)
          at java.util.LinkedHashMap.get(LinkedHashMap.java:440)
          at org.apache.pdfbox.cos.COSDictionary.getDictionaryObject(COSDictionary.java:188)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:102)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)
      
          [...]
          at org.apache.pdfbox.pdmodel.PDPageTree.getInheritableAttribute(PDPageTree.java:111)

      The issues can be reproduced with the attached files.

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            floyd floyd
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: