Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Remove : from allowed client_secret chars #8101

Merged
merged 8 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8101.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disallow `:` characters from being included in `client_secret` parameters across all related endpoints. This is a breaking change.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 1 addition & 3 deletions synapse/util/stringutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
_string_with_symbols = string.digits + string.ascii_letters + ".,;:^&*-_+=#~@"

# https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-register-email-requesttoken
# Note: The : character is allowed here for older clients, but will be removed in a
# future release. Context: https://github.com/matrix-org/synapse/issues/6766
client_secret_regex = re.compile(r"^[0-9a-zA-Z\.\=\_\-\:]+$")
client_secret_regex = re.compile(r"^[0-9a-zA-Z\.\=\_\-]+$")

# random_string and random_string_with_symbols are used for a range of things,
# some cryptographically important, some less so. We use SystemRandom to make sure
Expand Down