Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-1454

Fix nuxeo-pdf-viewer PDF preview when using stricter CSP

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.58
    • Component/s: Preview, UI

      Description

      Steps to reproduce:

      1. Configure Nuxeo with the following (stricter) CSP; sample .jar attached: 

      default-src 'self'; script-src 'self' data: connect.nuxeo.com apis.google.com app.box.com; style-src 'self' 'unsafe-inline' fonts.googleapis.com; img-src 'self'; font-src 'self' data: fonts.gstatic.com; media-src 'self'; frame-src 'self' www.nuxeo.com accounts.google.com; frame-ancestors 'self'
      

      2. In Web UI with LibreOffice installed (7.1.7 tested), import a .docx file as a File.
      3. Observe nuxeo-pdf-viewer in the document's View tab

      Expected result: Word document preview renders and is visible.

      Actual result: nuxeo-pdf-viewer preview pane remains empty, browser console displays following error (see screenshot):

      Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' data: connect.nuxeo.com apis.google.com app.box.com".
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 3 hours, 25 minutes
                  2d 3h 25m