Skip to content

Commit 68bd81a

Browse files
authored
Merge pull request #14957 from nextcloud/backport/14856/stable33
[stable33] docs(security): document __Host- prefix cookie warning and how to fix it
2 parents c8d2e8a + 42fa783 commit 68bd81a

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

admin_manual/configuration_server/security_setup_warnings.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,31 @@ Your database does not run with "READ COMMITTED" transaction isolation level
133133
This can cause problems when multiple actions are executed in parallel."
134134

135135
Please refer to :ref:`db-transaction-label` how to configure your database for this requirement.
136+
137+
The "__Host-" prefix is not used for the cookie name
138+
-----------------------------------------------------
139+
140+
"The ``__Host-`` prefix is not used for the cookie name. It is recommended to
141+
enable this in your configuration."
142+
143+
Nextcloud applies the ``__Host-`` prefix to its same-site CSRF cookies
144+
(``__Host-nc_sameSiteCookiestrict`` and ``__Host-nc_sameSiteCookielax``) when
145+
it detects that the connection is served over HTTPS. The prefix instructs
146+
browsers to only accept those cookies over a secure connection and from the
147+
exact host that set them, which strengthens CSRF protection.
148+
149+
This warning appears when Nextcloud cannot confirm it is running over HTTPS.
150+
The most common cause is a **reverse proxy** that terminates TLS and forwards
151+
requests to Nextcloud over plain HTTP. In that case Nextcloud sees HTTP
152+
internally and omits the prefix.
153+
154+
To fix this, tell Nextcloud to treat the connection as HTTPS by adding
155+
``overwriteprotocol`` to ``config/config.php``::
156+
157+
'overwriteprotocol' => 'https',
158+
159+
If you are not behind a reverse proxy, ensure your web server is configured to
160+
serve Nextcloud exclusively over HTTPS. See the
161+
:ref:`use_https_label` documentation.
162+
163+
For background on the cookies themselves, see :ref:`cookies`.

admin_manual/gdpr/cookies.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
.. _cookies:
2+
13
=======
24
Cookies
35
=======
46

57
.. sectionauthor:: Björn Schießle <bjoern@nextcloud.com>
6-
.. _cookies:
78

89
Nextcloud only stores cookies needed for Nextcloud to work properly. All cookies comes from your Nextcloud server directly, no 3rd-party cookies will be sent to your system. Regarding GDPR, `only data which contain personal data are relevant`_.
910

0 commit comments

Comments
 (0)