nextcloud / nextcloud/server

Strict CSP doesn't work when rules are enforced by web server

Open
#14,980 14 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement security
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

I was under the impression that Nextcloud was supporting strict CSPs now, but for Nextcloud (16.0.2) to run on my server, I still have to allow:

  • 'unsafe-inline' in script-src (PR #16380)
  • 'unsafe-inline' in style-src
  • data: in img-src
  • data: in font-src

Without these options (the first 2 atleast), after logging in, the files app fails to load anything, and all the app icons in the header display loading icons, and fail to finish loading.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the post-login failure with the web server enforcing a strict CSP, then inspect the browser console while loading the Files app and header icons. Done means Nextcloud works without the listed unsafe-inline or data: allowances; the issue does not name a file or test to target.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.