Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDFViewer / CSP - frame-src object-src blob: #8498

Merged
merged 2 commits into from
Feb 27, 2023
Merged

Conversation

vkael
Copy link
Contributor

@vkael vkael commented Feb 23, 2023

Description

Using Owncloud Web 6.0.0, it is not possible to display a PDF using PDF Viewer cause the CSP is too restrictive.

It returns :

Content Security Policy: The page’s settings blocked the loading of a resource at blob:https://xyz.com/bb6b39b8-1d71-4960-bc4c-16ab79bc1044 (“default-src”).

Related Issue

Motivation and Context

PDF will be working on Firefox out of the box.

How Has This Been Tested?

  • test environment:
    Old owncloud server running, updated to 10.11; added new configuration to support OwnCloud Web new front-end.

Screenshots (if appropriate):

Before :
CSP configuration :
image

View :
image

After, with updated CSP and visible PDF :
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@update-docs
Copy link

update-docs bot commented Feb 23, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@CLAassistant
Copy link

CLAassistant commented Feb 23, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big thanks for the contribution, works like a charm! 🥳

changelog/8498 Outdated
@@ -0,0 +1,7 @@
Bugfix: PDF display issue - Update CSP object-src policy
Copy link
Collaborator

@JammingBen JammingBen Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please give the changelog file a proper title though? Something like bugfix-oc10-pdf-display.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sonarcloud
Copy link

sonarcloud bot commented Feb 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@kulmann kulmann merged commit 752a6ba into owncloud:master Feb 27, 2023
@vkael vkael deleted the patch-1 branch February 27, 2023 14:05
@micbar micbar mentioned this pull request May 3, 2023
89 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Needs-Review Needs review from a maintainer
Projects
None yet
5 participants