Server: User icons do not appear in contacts menu due to CSP error on Nextcloud 15

Created on 20 Jan 2019  路  3Comments  路  Source: nextcloud/server

I noticed that user's icons were not showing up next to their names in the contacts menu on my production server. I had recently upgraded from Nextcloud 14. I recreated another Nextcloud instance from the official Docker image (nextcloud:latest) from DockerHub for testing purposes and I still see the same issue.

Steps to reproduce

  1. Start new Nextcloud 15.02 server from the official Docker image
  2. Make absolutely no modifications to the server
  3. Access the server through a reverse HTTPS proxy
  4. Add 2 test users to the server though the UI
  5. Click on the contacts icon in the top right of the UI

Expected behavior

User icons should be displayed next to the users' names. The console should not show errors.

Actual behavior

No icons appear next to the users. The developer console shows the following error:

Refused to load the image 'http://localhost/remote.php/dav/addressbooks/system/system/system/Database:user1.vcf?photo&size=64' because it violates the following Content Security Policy directive: "img-src 'self' data: blob:".

screen shot 2019-01-20 at 6 38 15 am
screen shot 2019-01-20 at 6 38 28 am

Note that the server URL is https://localhost, not http://localhost. The error appears because the image URL is prefixed with http:// instead of https://. Ideally, this should be a relative link and should not try to access the HTTP URL when the server was accessed through HTTPS.

I noticed this issue on the latest Chrome, but can confirm that it is present on the latest Safari and Firefox as well.

0. Needs triage bug

Most helpful comment

@danielkesselberg Thank you for your suggestion! Adding 'overwriteprotocol' => 'https', to config.php resolved the issue!

All 3 comments

Same problem on the Activities page.

screen shot 2019-01-20 at 7 21 39 am

screen shot 2019-01-20 at 7 21 51 am

@danielkesselberg Thank you for your suggestion! Adding 'overwriteprotocol' => 'https', to config.php resolved the issue!

Was this page helpful?
0 / 5 - 0 ratings