-
Couldn't load subscription status.
- Fork 414
MSC4293: Redact on kick/ban #4293
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
turt2live
wants to merge
13
commits into
main
Choose a base branch
from
travis/msc/user-redact
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 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1cafc16
MSC: Redact on ban
turt2live b9391a0
Add some clarity
turt2live 6d92bba
Add more considerations
turt2live 687db4c
Misc clarifications
turt2live aabe751
Update proposals/4293-redact-on-ban.md
turt2live b06afd7
Rewrite intro & problem statement
turt2live 244082a
Clarify proposal body and adjust the fallback recommendation
turt2live a78f536
Clarify early that self-leaves aren't allowed
turt2live d9413f5
typo
turt2live 0946c5c
cite MSC4343
turt2live ebc60f1
format potential issues
turt2live 209cad3
Cover more issues
turt2live 616b4a8
typos
anoadragon453 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
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,117 @@ | ||
| # MSC4293: Redact on ban | ||
|
|
||
| [MSC2244 (accepted)](https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/2244-mass-redactions.md)-style | ||
| mass redactions are incredibly helpful for cleaning up large volumes of spam, but still require sending | ||
| a dedicated event to clean up the spam. In a typical case, a user will get kicked/banned from a room | ||
| and the moderators will further redact some or all of their messages. Mass redactions have more use | ||
| cases, but the specific case of "redact everything upon ban" is something which may be easily backported | ||
| to existing room versions. | ||
turt2live marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This proposal suggests adding a new flag to membership events to indicate to clients and servers that | ||
| all of that user's events should be redacted in addition to being kicked or banned. The flag isn't | ||
| protected from redaction itself, so may have some consistency issues, but overall should still provide | ||
| relatively high amounts of protection to rooms. | ||
|
|
||
| This proposal is exploratory and subject to change. Implementations may validate the idea through | ||
| early feature support, but MUST expect that things will change (or become completely rejected). | ||
|
|
||
turt2live marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ## Proposal | ||
|
|
||
| A new flag is added to [`m.room.member`](https://spec.matrix.org/v1.14/client-server-api/#mroommember) | ||
| events where the target user is kicked or banned (**TODO**: Allow on self-leaves too?): `redact_events`. | ||
| This flag is a boolean and, when `true`, causes servers (and clients) to redact all of the user's events | ||
| as though they received an [`m.room.redaction`](https://spec.matrix.org/v1.14/client-server-api/#mroomredaction), | ||
| including adding [`redacted_because`](https://spec.matrix.org/v1.14/client-server-api/#redactions) to | ||
| `unsigned` where applicable. An `m.room.redaction` event is not actually sent, however. | ||
|
|
||
| **Note**: This also means that if the user was kicked/banned with a `reason`, that event is automatically | ||
| compatible with the redaction `reason` field and shows up accordingly. | ||
|
|
||
| Similar to regular redactions, if the sender of the membership event can't actually redact the target's | ||
| events, the redaction doesn't apply. This means having a power level higher than or equal to `redacts` | ||
turt2live marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| *and* `events["m.room.redaction"]` (if set). Normally, `m.room.redaction` events could be rejected | ||
| due to the power levels - that rejection behaviour doesn't apply with the `redact_events` field. | ||
| Instead, the target's events are simply not redacted. | ||
|
|
||
| If the sender is allowed to redact, the redaction behaviour continues until the membership event itself | ||
| is redacted (thus removing the field) or another membership event removes the field. For example, if | ||
| the user is unbanned, the moderator MAY NOT choose to carry the `redact_events` flag to that kick | ||
| (unban) event. Or, when the user rejoins after a kick, the flag is implicitly dropped. | ||
turt2live marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Events which are delivered after the ban are likely [soft failed](https://spec.matrix.org/v1.14/server-server-api/#soft-failure) | ||
| and are still redacted if the current membership event in the room has a valid `redact_events` | ||
| field. | ||
|
|
||
| Other membership states with the flag no-op, such as joins, knocks, and invites. | ||
|
|
||
| Moderation bots and similar MAY still wish to issue (mass) redactions upon kick/ban to protect users | ||
| on servers or clients which don't have this feature. | ||
turt2live marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Example ban: | ||
|
|
||
| ```jsonc | ||
| { | ||
| // Irrelevant fields excluded | ||
| "type": "m.room.member", | ||
| "state_key": "@spam:example.org", | ||
| "sender": "@mod:example.org", | ||
| "content": { | ||
| "membership": "ban", | ||
| "reason": "flooding", // this is copied to `redacted_because`, leading to clients showing it | ||
| "redact_events": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| The new field is proxied through to the event by the [`/kick`](https://spec.matrix.org/v1.14/client-server-api/#post_matrixclientv3roomsroomidkick) | ||
| and [`/ban`](https://spec.matrix.org/v1.14/client-server-api/#post_matrixclientv3roomsroomidban) | ||
| sugar APIs, like `reason` is. | ||
|
|
||
| ## Potential issues | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| It's a little annoying that the flag is redacted when the membership event is redacted, however it's | ||
| extremely rare for a moderator/admin to redact a kick or ban event. This can be fixed in a future | ||
| room version, like what is proposed by [MSC4298](https://github.com/matrix-org/matrix-spec-proposals/pull/4298). | ||
|
|
||
| Though extremely rare, if an existing server in the room didn't apply the redactions *and* a sender's | ||
| ban was redacted, a new server to the room may backfill through that existing server and see unredacted | ||
| events without knowing it's supposed to redact them due to the ban having lost the `redact_events` | ||
| field. This is fixed for future room versions by implementing something like [MSC4298](https://github.com/matrix-org/matrix-spec-proposals/pull/4298). | ||
|
|
||
| Clients may miss the membership event if they are using lazy loading, though servers should already | ||
| be tracking which membership events the client has received and needs to render events in the timeline. | ||
| This should mean that those clients will still receive the event. | ||
|
|
||
| Servers which miss the event will eventually receive or retrieve it, just like they would with any | ||
| other event. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| Mass redactions are the cited major alternative, where a single event can target approximately 1500 | ||
| other events in the room. New rooms can benefit from that functionality, especially for cases not | ||
| covered by this proposal, while existing rooms can be given an option to protect their users with | ||
| relative ease. | ||
|
|
||
| ## Security considerations | ||
turt2live marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| As the room moderator/administrator would already send redactions, and may still for full protection, | ||
| it's not deemed any more risk than today. This may change if self-leaves are permitted to also carry | ||
| the field. | ||
|
|
||
| There may also be implementation or reliability bugs which inhibit the "stop redacting now" point | ||
| from working as intended. Server implementations in particular should ensure that an event received | ||
| after a membership event which asks for redaction is *really* affected by that redaction. ie: whether | ||
| it's just a late delivery, or if there's a join waiting for state res to make a determination. | ||
|
|
||
| ## Unstable prefix | ||
|
|
||
| While this proposal is not considered stable, implementations should use `org.matrix.msc4293.redact_events` | ||
| instead of `redact_events`. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| This MSC has no direct dependencies. | ||
|
|
||
| ## Credits | ||
|
|
||
| Credit goes to Erik of the Spec Core Team for the suggestion to look into this. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.
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:
Other non-qualifying (as of writing) implementations: