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

IllegalArgumentException in computeEncryptedKeyRev56

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.22, 3.0.0 PDFBox
    • Fix Version/s: 2.0.23, 3.0.0 PDFBox
    • Component/s: Crypto
    • Labels:
      None

      Description

      The attached PDF generates the following stack trace when loaded via Loader.loadPDF (using current Git revision 877fe27feaa36e7d24119b053ef41c4247f0691d):

      java.lang.IllegalArgumentException: Null input buffer
      at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2201)
      at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.computeEncryptedKeyRev56(StandardSecurityHandler.java:751)
      at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.computeEncryptedKey(StandardSecurityHandler.java:658)
      at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.prepareForDecryption(StandardSecurityHandler.java:210)
      at org.apache.pdfbox.pdfparser.COSParser.prepareDecryption(COSParser.java:2522)
      at org.apache.pdfbox.pdfparser.COSParser.rebuildTrailer(COSParser.java:1885)
      at org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:263)
      at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:127)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:180)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:154)
      at org.apache.pdfbox.Loader.loadPDF(Loader.java:204)
      at com.example.PdfBoxFuzzer.fuzzerTestOneInput(PdfBoxFuzzer.java:31)

      While the PDF is clearly broken, the type of thrown exception is unexpected (not an IOException).

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              Meumertzheim Fabian Meumertzheim
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: