-
Notifications
You must be signed in to change notification settings - Fork 401
MSC4303: Disallowing non-compliant user IDs in rooms #4303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tulir
wants to merge
6
commits into
main
Choose a base branch
from
tulir/slighty-strict-user-id-grammar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5c29e03
Proposal to disallow non-compliant user IDs in rooms
tulir dacb6f0
Mention that the spec already recommends dropping non-room-scoped dat…
tulir d97f844
Also forbid empty localparts :(
tulir 46c28b7
Clarify that room ID grammar is handled by other MSCs
tulir 11cfb27
Fix word
tulir 512566b
Specify base room version for unstable prefix
tulir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
proposals/4303-slightly-strict-user-id-grammar-in-rooms.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# MSC4303: Disallowing non-compliant user IDs in rooms | ||
|
||
The specification presently allows for a "historical" grammar for user IDs, described | ||
[here](https://spec.matrix.org/v1.15/appendices/#historical-user-ids). The use of this historical | ||
character set has allowed for "weird" and generally not-great user IDs to appear in the wild, | ||
causing a variety of issues for software projects. | ||
|
||
The historical grammar can be split into two classes: | ||
|
||
1. printable ASCII (U+0021 to U+007E), aka. historical-but-compliant | ||
2. arbitrary unicode and blank localparts, aka. non-compliant | ||
|
||
This proposal uses a future room version to prohibit the second class, while still allowing the first. | ||
Users with non-ASCII user IDs will not be able to join or participate in those room versions. | ||
|
||
This proposal does not cover room ID grammar, as that will be handled by another MSC, | ||
such as [MSC4051](https://github.com/matrix-org/matrix-spec-proposals/pull/4051). | ||
|
||
## Proposal | ||
|
||
In a future room version, the historical-but-compliant grammar for user IDs is strictly enforced on | ||
all places a user ID can appear in an event. | ||
|
||
* The `sender` of all events. | ||
* The `state_key` of `m.room.member` events. | ||
* The `join_authorised_via_users_server` field in `m.room.member` events. | ||
* Keys of the `users` object in `m.room.power_levels`. | ||
|
||
User IDs in the new room version must only consist of ASCII characters between U+0021 and U+007E | ||
and the localpart must not be empty. | ||
|
||
By making this change in a room version, non-compliant user IDs are slowly removed from the public | ||
federation. Several rooms will naturally upgrade to a room version which includes this MSC's change | ||
after it becomes available in servers, and eventually the specification will update the | ||
[recommended default room version](https://spec.matrix.org/v1.15/rooms/#complete-list-of-room-versions) | ||
to include this MSC's change as well to affect new room creation. | ||
|
||
In short, this MSC starts a multi-year process to formally phase out non-compliant user IDs as new | ||
(and existing through upgrades) rooms use a room version which bans such user IDs. | ||
|
||
## Potential issues | ||
|
||
Unlike [MSC4044](https://github.com/matrix-org/matrix-spec-proposals/pull/4044), this MSC does | ||
not define all historical user IDs as non-compliant. Therefore, real users who registered historical | ||
user IDs should not be affected. Only accounts registered by modified servers will be prohibited | ||
from participating in new rooms. Additionally, the existing spec already recommends servers drop | ||
traffic from such non-compliant user IDs outside of rooms (e.g. in to-device events), which means | ||
such users may already not be able to participate in encrypted rooms. | ||
|
||
## Alternatives | ||
|
||
[MSC4044](https://github.com/matrix-org/matrix-spec-proposals/pull/4044) | ||
|
||
We don't do this, or hope that pseudo IDs fix the problem. | ||
|
||
## Security considerations | ||
|
||
This MSC improves the security posture of the protocol by reducing the likelihood of strange characters | ||
appearing in user IDs. | ||
|
||
## Unstable prefix | ||
|
||
This MSC can be implemented in a room version identified as `fi.mau.msc4303` building on top of | ||
room version 11. A future MSC will be required to incorporate this MSC into a stable room version. | ||
|
||
## Dependencies | ||
|
||
None. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation requirements: