-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 blocks resources #17783
Comments
Are you able to reproduce the same with chromium browsers? |
I am having the same issue. Pages are taking over a minute to load. Browsers Attempted: Chrome (Desktop and Mobile), Firefox (Desktop and Mobile), Edge (Desktop), Safari (Desktop and Mobile) The NextCloud mobile apps (NextCloud, Bookmarks, Notes, etc) all work fine, WebDav is working fine. Seems to just be an issue with the content policy for browsers. |
I wanted to chime in and say I think I solved the issue, turns out it may not be related to browser bug.
Solution:
Maybe just my case but thats what solved it for me... EDIT: Reenabled "themeing" app after I had a successful page load. No issues reenabling. Going to attempt to turn back on caching. |
@ohmybrew could you share the exact message for the locked server.scss? |
@kesselb Two messages:
Disabling the memcache/filelocking solved the issue for the moment, NextCloud was able to rebuild the missing assets (not sure why they disappeared). I re-enabled it, and all was fine. I really think the CSP error (for me anyways) came from the fact NextCloud was trying to build those assets, because anything going to |
Can confirm this bug exists in NC 17.0.2 |
Not a nextcloud issue:
Details are here bugzilla.mozilla.org/show_bug.cgi?id=1591807 |
@juliushaertl please do not close a valid issue. This is not unique to Firefox. As stated above this is seen in all browsers. This has also been my experience since upgrading to nextcloid 17. |
If you can reproduce with Chrome please share the network tab from chrome as well as the console log. |
@brandonkal Please also try to provide a more detailed description of which issue you encounter. |
The first report is clearly the firefox issue. Somehow people hijacked the issue with their problem. We don't have a valid issue template except the firefox one so I'm closing this again. Feel free to report a new issue with the initial template so someone can have a proper look. |
Compare |
Fair.
Thank you for such fast reply. |
No cloudflare here and same error. |
Same problem here. Fresh installed Nextcloud... |
@kesselb as you can see many people are facing this issue. Could you please check if it makes sense to reopen this issue? Thanks |
What issue are you facing exactly? Is there something broken or just the blocked resources in networks? juliushaertl posted a link to mozilla's bug tracker about 5 months ago. That issue is open. If you see those blocked csp requests in Firefox but not with Chrome (or any other chromium based browser) and your instance works fine there is nothing to worry. |
@aljaxus you see the same issue with Chrome on the demo instance? |
I do not. Using chrome |
That's the Firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1591807 If someone has the blocked csp resources with Firefox AND Chrome please post:
I'm still having issue to understand your problem. I see those blocked csp resources as well but my instance works fine. It's possible to login, upload files, create users, etc. @burner-account @felix @SupRavII beside the blocked request was there something else not working? |
Because you have the blocked resourced already in your local browser cache. If the resources are getting blocked and you do not have these blocked resources in your local browser cache then nothing works anymore. |
@kesselb Please excuse my late answer. I don't recall any other issue. But since the blocking behaviour prevented users/admins from logging into nextcloud, nothing could have triggered other errors on our end. |
Find this an interesting issue/thread. Most of the comments refer to Mozilla Firefox. There, as already noted by others, is a known Firefox bug. But the bug is not so tragic, because the resources are loaded on a second request. Also, the bug must be fixed by Mozilla and not Nextcloud. So the Firefox problem is not really a problem at this time. The following users report that the problem also happens in Chrome:
But the user could already solve the problem, apparently a caching problem. There was a problem with memcache, not necessarily a nextcloud problem. This can have many reasons. Other users also mention problems with Firefox, but then don't answer once you point out that it is a known Firefox problem. Any many don't write if they have only seen the error messages or if there are actually problems. And theres User like @burner-account:
I mean: Seriously?! The issue is open since 2019 and only a few users have problems. And most of them have only seen the error message, but the installation works anyway -- because it's in there case the Firefox bug. Nextcloud is used by hundreds of thousands of users. It is very unlikely that many users have problems and say nothing. The problem that no login is possible, or parts are missing in the admin interface, cannot be reproduced by any Nextcloud developer. Otherwise someone would obviously have started looking for the problem long ago. In IT you have to admit that sometimes the problem is not in the software you use. Maybe a manually caused configuration error. Or a faulty app. Or a faulty LAMP/LEMP-Stack. Or a server side caching problem. Not everything is always a problem of the software you use. The difficult thing about such problems: These are all problems that nobody can solve here because they are not reproducible. Debug yourself! Get involved! Answering here only with meaningless screenshots and sentences without technical details does not help at all. |
It's just Nextcloud (local instance, public instance, demo instance) on my Chrome & Firefox that is causing this issue, never had this issue for other applications/websites. According to your statement, let's close this issue.... |
We had the same rendering issue with Firefox and Chrome browsers, all js files were CSP blocked. We could track it down to a Redis issue. How to fix it:
UPDATE: The CSP behaviour came back after one day of operation with Redis. Deactivated Redis now completely, pages render okay now. |
While this is a Firefox issue, I think it's worth mentioning that it causes Firefox to wait for 25 (on my instance) requests to be blocked before trying them again on every page load; this causes a wait of up to several seconds per page, making Nextcloud seem much slower than it actually is. |
I don't get it. I asked for more information more than once. Every Nextcloud setup is different. To have a starting point for further debugging we need at least the issue template (and the other information I requested in the meantime). Also check if you see the same issue with: https://try.nextcloud.com/.
That's bad but how does your post pushes this issue forward? You missed that we still waiting for more information and closed the issue because noone ever provided it? I could imagine that some app is responsible for such blocks as well.
https://www.troyhunt.com/locking-down-your-website-scripts-with-csp-hashes-nonces-and-report-uri/ |
@kesselb in my first post, I mentioned that this is reproducible in the Nextcloud docker image. Fresh installation w/o additional configuration. Please let me know what is missing |
To be more precise: I'm still looking for a way how to reproduce that issue. What issue exactly? A situation when scripts are not loaded in Chrome and Firefox caused by a broken / invalid / missing / whatever csp configuration / header.
Just started a fresh container (nextcloud:18-apache) on a random port and run the setup. Visited the page with Chrome and Firefox (cache disabled via dev tools). I see the blocked request in Firefox. I don't see blocked request in Chrome. It's possible to login, upload files, etc. |
@kesselb Considering that you saw the issue yourself, I'd think the issue as reported (not broken functionality) should be considered confirmed by now.
|
I'm only interested in setups with broken functionality (e.g it's not possible to login).
I'm not able to confirm this observation. The difference in time until the page is delivered between Firefox and Chrome is minimal. If you run into the situation with a notable different (keep in mind most people don't disable the cache) the issue must be something different. That's actually my biggest concern about this Firefox issue. People assume that their problem is somehow related to this blocked request but the issue is something different. If you have proof that the requests take much longer because of the blocked request feel free to add it. |
Other than usage seems about twice as fast in Chrome or Brave than in Firefox and that Firefox's inspector shows the second request being stuck waiting for the requests that cancel, I'm not sure what to add. |
@ burner account @felix @SupRavII next to the blocked request, was something else not working? Hello kesselb among the problems encountered with this CSP blocking I will list mine. For information I have two instances of NEXTCLOUD on two different servers: NEXTCLOUD 18 permanently updated including for Plugins. Firefox or Chrome or Chomium (Linux)
Here are the main problems encountered and still topical for me. |
No. I don't have a login at this instance (it's the instance of sebastiansterk who started this topic). I shared this screen cast to demonstrate that (although some scripts are blocked) it's possible to submit a login request and switch to the reset password form.
If someone has the blocked csp resources with Firefox AND Chrome please post:
|
I tested with my instance (behind couple of proxys) and try.nextcloud.com and get same CSP errors as I get from my own instance. These are my headers (curl -I)
and these are try.nextcloud.com
I think these are headers that are diffrent (I use NGINX and otherwise try.nextcloud.com is on Apache2 httpd
There is small amount of headers. I can log in/upload and download so this kind of small problem to me. |
I got a similar (?) issue with Nextcloud 18.0.6 on Firefox 78 and Chromium 83. I temporarily changed CSP header to do not use a On Chromium I saw that loading of scripts may fail with |
I think this is somehow problem about double CSP headers which confuses Mozilla SSL tester too |
Clean install of the latest version of Nextcloud, using both snap and For example, one of the scripts my Nextcloud instance is serving is Any ideas why this might be happening? I definitely think the issue needs to be re-opened. Edit: Hrm, that's... really weird. It looks like it actually is being served - using cURL to request the page is working - but something is happening to it to get rid of it before it's actually used. And it's not a browser extension, because my Chromium install is extension-free... Something very odd is going on here. |
Using Nextcloud 20.0.0 with Iridium/Chromium
Can I tune Content-Security-Policy someway to be fully usable with Nextcloud 20 ? |
@narcisgarcia I'm running into the same problem (but I'm using nginx). Did you found any solution for that? |
Having the same problem, Firefox Developer Edition 128.0b9 (64-bit). Works fine with Brave . |
Steps to reproduce
Expected behaviour
Resources should not be blocked by CSP.
Actual behaviour
Resources are blocked by CSP.
Server configuration
Operating system:
Debian 10 Buster (from Nextcloud Docker Image)
Web server:
Apache through Nextcloud Docker Image (nextcloud:17, nextcloud:16, nextcloud:latest)
Database:
mariadb
PHP version:
7.3 (from Nextcloud Docker Image)
Nextcloud version: (see Nextcloud admin page)
Updated from an older Nextcloud/ownCloud or fresh install:
fresh install
Where did you install Nextcloud from:
Official Nextcloud Docker Image (nextcloud:17, nextcloud:16, nextcloud:latest)
Prod Instance:

Local nonprod instance:

Maybe this issue is also related to #17781
Signing status:
Signing status
Client configuration
Browser:
latest Firefox and latest Chrome
Operating system:
Ubuntu
The text was updated successfully, but these errors were encountered: