File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
changelogs/client_server/newsfragments
content/client-server-api/modules Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ The `server-name` segment of MXC URIs is sanitised differently from the `media-id` segment.
Original file line number Diff line number Diff line change @@ -134,9 +134,14 @@ entity isn't in the room.
134134` mxc:// ` URIs are vulnerable to directory traversal attacks such as
135135` mxc://127.0.0.1/../../../some_service/etc/passwd ` . This would cause the
136136target homeserver to try to access and return this file. As such,
137- homeservers MUST sanitise ` mxc:// ` URIs by allowing only alphanumeric
138- (` A-Za-z0-9 ` ), ` _ ` and ` - ` characters in the ` server-name ` and
139- ` media-id ` values. This set of whitelisted characters allows URL-safe
137+ homeservers MUST sanitise ` mxc:// ` URIs by:
138+
139+ - restricting the ` server-name ` segment to valid
140+ [ server names] ( /appendices/#server-name )
141+ - allowing only alphanumeric (` A-Za-z0-9 ` ), ` _ ` and ` - ` characters in
142+ the ` media-id ` segment
143+
144+ The resulting set of whitelisted characters allows URL-safe
140145base64 encodings specified in RFC 4648. Applying this character
141146whitelist is preferable to blacklisting ` . ` and ` / ` as there are
142147techniques around blacklisted characters (percent-encoded characters,
You can’t perform that action at this time.
0 commit comments