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

CSP Violation #208

Closed
mightycoco opened this issue Jul 7, 2015 · 4 comments
Closed

CSP Violation #208

mightycoco opened this issue Jul 7, 2015 · 4 comments

Comments

@mightycoco
Copy link

OC 8.1 (TSL connection)
Googlew Chrome 43
Firefox 38
Windows 8.1

When trying to open an folder with images, the thumbanils are not loaded. Looking at the debugger, for each inline-thumbnail there is a CSP Violation:

Refused to load the image 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBl…vAd6l8E8ZIHHtRRUvYpbnd5DHjkUtFFYmoUE0UUDG1nsuZ5D70UVM9io7kZyDyKKKKwNT/2Q==' because it violates the following Content Security Policy directive: "img-src 'self'".

According to the CSP Spec, the site shoudl specify a meta-tag to indicate data: sources specify an actual data segment.

The page should have following meta-tag in the header to allow inline image data.

<head>
...
<meta http-equiv="Content-Security-Policy" content="img-src 'self' data:;" />
...
</head>

@LukasReschke
Copy link
Member

@oparoz Can be easily fixed by adjusting the policy and also allow "data:"

@oparoz
Copy link
Contributor

oparoz commented Jul 7, 2015

The policy is already there
Content-Security-Policy:"default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *; connect-src *"

2 possibilities

  • The cache has not been refreshed and files of the old version are being served on 8.1, which is not going to work or
  • the wrong version got installed.

@mightycoco - Could you check apps/galleryplus/appinfo/info.xml to see if it's the version for 8.1?
If it is, please do a CTRL+F5

If it still doesn't work, I'll need to thumbnail URL, something like:
thumbnails?ids=171421%3B171389%3B171388%3B171373&scale=1&square=0&requesttoken=ohGsUBM72XTMcvYQd6pUdV%2B%2FhPRQt0

@mightycoco
Copy link
Author

Aha! there must have been something with the cache. Doing a CTRL-R gives the correct CSP header with img-src * instead of img-src 'self'!

@oparoz
Copy link
Contributor

oparoz commented Jul 7, 2015

OK, thanks for confirming :)

@oparoz oparoz closed this as completed Jul 7, 2015
MorrisJobke added a commit that referenced this issue Jul 25, 2015
[stable8.1] Make compatible with IE 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants