Skip to content

Commit 022e56c

Browse files
authored
Move security note from README into the docs (#19259)
This is a) to simplify the README and b) so that we can easily link to the security page from e.g. the installation guide. Follows on from #19228
1 parent a8e5c31 commit 022e56c

File tree

5 files changed

+51
-49
lines changed

5 files changed

+51
-49
lines changed

README.rst

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -42,61 +42,13 @@ There are three editions of ESS:
4242

4343
The Synapse documentation describes `options for installing Synapse standalone
4444
<https://element-hq.github.io/synapse/latest/setup/installation.html>`_. See
45-
below for more useful documenation links.
45+
below for more useful documentation links.
4646

4747
- `Synapse configuration options <https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html>`_
4848
- `Synapse configuration for federation <https://element-hq.github.io/synapse/latest/federate.html>`_
4949
- `Using a reverse proxy with Synapse <https://element-hq.github.io/synapse/latest/reverse_proxy.html>`_
5050
- `Upgrading Synapse <https://element-hq.github.io/synapse/develop/upgrade.html>`_
5151

52-
Platform dependencies
53-
---------------------
54-
55-
Synapse uses a number of platform dependencies such as Python and PostgreSQL,
56-
and aims to follow supported upstream versions. See the `deprecation policy
57-
<https://element-hq.github.io/synapse/latest/deprecation_policy.html>`_ for more
58-
details.
59-
60-
61-
Security note
62-
-------------
63-
64-
Matrix serves raw, user-supplied data in some APIs — specifically the `content
65-
repository endpoints`_.
66-
67-
.. _content repository endpoints: https://matrix.org/docs/spec/client_server/latest.html#get-matrix-media-r0-download-servername-mediaid
68-
69-
Whilst we make a reasonable effort to mitigate against XSS attacks (for
70-
instance, by using `CSP`_), a Matrix homeserver should not be hosted on a
71-
domain hosting other web applications. This especially applies to sharing
72-
the domain with Matrix web clients and other sensitive applications like
73-
webmail. See
74-
https://developer.github.com/changes/2014-04-25-user-content-security for more
75-
information.
76-
77-
.. _CSP: https://github.com/matrix-org/synapse/pull/1021
78-
79-
Ideally, the homeserver should not simply be on a different subdomain, but on
80-
a completely different `registered domain`_ (also known as top-level site or
81-
eTLD+1). This is because `some attacks`_ are still possible as long as the two
82-
applications share the same registered domain.
83-
84-
.. _registered domain: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-2.3
85-
86-
.. _some attacks: https://en.wikipedia.org/wiki/Session_fixation#Attacks_using_cross-subdomain_cookie
87-
88-
To illustrate this with an example, if your Element Web or other sensitive web
89-
application is hosted on ``A.example1.com``, you should ideally host Synapse on
90-
``example2.com``. Some amount of protection is offered by hosting on
91-
``B.example1.com`` instead, so this is also acceptable in some scenarios.
92-
However, you should *not* host your Synapse on ``A.example1.com``.
93-
94-
Note that all of the above refers exclusively to the domain used in Synapse's
95-
``public_baseurl`` setting. In particular, it has no bearing on the domain
96-
mentioned in MXIDs hosted on that server.
97-
98-
Following this advice ensures that even if an XSS is found in Synapse, the
99-
impact to other applications will be minimal.
10052

10153
🎯 Troubleshooting and support
10254
==============================

changelog.d/19259.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplify README and add ESS Getting started section.

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# Setup
77
- [Installation](setup/installation.md)
8+
- [Security](setup/security.md)
89
- [Using Postgres](postgres.md)
910
- [Configuring a Reverse Proxy](reverse_proxy.md)
1011
- [Configuring a Forward/Outbound Proxy](setup/forward_proxy.md)

docs/setup/installation.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ that your email address is probably `[email protected]` rather than
1616
`[email protected]`) - but doing so may require more advanced setup: see
1717
[Setting up Federation](../federate.md).
1818

19+
⚠️ Before setting up Synapse please consult the [security page](security.md) for
20+
best practices. ⚠️
21+
1922
## Installing Synapse
2023

24+
Note: Synapse uses a number of platform dependencies such as Python and PostgreSQL,
25+
and aims to follow supported upstream versions. See the [deprecation
26+
policy](../deprecation_policy.md) for more details.
27+
2128
### Prebuilt packages
2229

2330
Prebuilt packages are available for a number of platforms. These are recommended

docs/setup/security.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Security
2+
3+
This page lays out security best-practices when running Synapse.
4+
5+
If you believe you have encountered a security issue, see our [Security
6+
Disclosure Policy](https://element.io/en/security/security-disclosure-policy).
7+
8+
## Content repository
9+
10+
Matrix serves raw, user-supplied data in some APIs — specifically the [content
11+
repository endpoints](https://matrix.org/docs/spec/client_server/latest.html#get-matrix-media-r0-download-servername-mediaid).
12+
13+
Whilst we make a reasonable effort to mitigate against XSS attacks (for
14+
instance, by using [CSP](https://github.com/matrix-org/synapse/pull/1021)), a
15+
Matrix homeserver should not be hosted on a domain hosting other web
16+
applications. This especially applies to sharing the domain with Matrix web
17+
clients and other sensitive applications like webmail. See
18+
https://developer.github.com/changes/2014-04-25-user-content-security for more
19+
information.
20+
21+
Ideally, the homeserver should not simply be on a different subdomain, but on a
22+
completely different [registered
23+
domain](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-2.3)
24+
(also known as top-level site or eTLD+1). This is because [some
25+
attacks](https://en.wikipedia.org/wiki/Session_fixation#Attacks_using_cross-subdomain_cookie)
26+
are still possible as long as the two applications share the same registered
27+
domain.
28+
29+
30+
To illustrate this with an example, if your Element Web or other sensitive web
31+
application is hosted on `A.example1.com`, you should ideally host Synapse on
32+
`example2.com`. Some amount of protection is offered by hosting on
33+
`B.example1.com` instead, so this is also acceptable in some scenarios.
34+
However, you should *not* host your Synapse on `A.example1.com`.
35+
36+
Note that all of the above refers exclusively to the domain used in Synapse's
37+
`public_baseurl` setting. In particular, it has no bearing on the domain
38+
mentioned in MXIDs hosted on that server.
39+
40+
Following this advice ensures that even if an XSS is found in Synapse, the
41+
impact to other applications will be minimal.

0 commit comments

Comments
 (0)