Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-13190

PDF-Check: Just delete unsafe PDF files

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Done
    • Upcoming Branch
    • None
    • framework/security
    • None

    Description

      This refers to the implementation within SecuredUpload.java:

      Currently, all PDF files are deleted after the check within isValidPdfFile - regardless of whether they have been successfully validated or not. As with other format validations, we should keep the valid files directly so that they can be processed afterwards. The mentioned behavior was introduced by https://github.com/apache/ofbiz-framework/commit/c3653d51ae88e6a0069bb750d8d36c7fa0e4e1a7:

      file = new File(fileName);
      file.delete(); 

      At first I planned to change the implementation to just delete the PDF file within isValidPdfFile if the PDF's safeState is false. Then I found out that the file deletion already happens withn isValidFile (deleteBadFile) - hence there is no need to delete the invalid file within the PDF check itself.

      Attachments

        Activity

          People

            jleroux Jacques Le Roux
            sixtyone Sixty One
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: