matrix-org / matrix-org/matrix-spec

A server which is ACLed from a room cannot leave the room

Open
#397 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Client-Server feature
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

The Server Access Control List room state event and functionality announced by matrix-org/matrix-spec-proposals#1383 instructs all servers in a room to broadcast events to a banned server without allowing it to ever unsubscribe from such broadcasts.

In the case where a target host is banned via a `m.room.server_acl` but the host still has at least one user joined to the room, PDU's will continue to be sent to the banned target by remaining servers. That itself is specified and acceptable functionality, but a problem arises when the target server wishes to unsubscribe from the room: there is no mechanism to do so.

This is problematic for both the adversarial target server _and_ the honest remaining room servers.
- The target is effectively spammed with messages for all time, even after its clients try to leave or the server chooses to withdraw them upon being banned.
- The remaining room servers expend effort to broadcast to the banned servers for all time or until an operator of a room withdraws all users from the banned server by other means.

Remember, these messages are not just limited to that room's events: calculations for where to broadcast presence updates, etc, may be burdened by this room's introduction of the banned servers.

#### Suggested solutions

- The application of the ACL can be extended to outgoing units and not just incoming. This is a hard and coarse solution. As an aside, I'm not entirely clear on why the original specified behavior of matrix-org/matrix-spec-proposals#1383 did not achieve this.

- The `/send_leave` endpoint is removed from the list of endpoints which check for an ACL. This allows for the banned target to unsubscribe its users from the room as its only possible action. Note, to prevent a banned server from spamming events through this endpoint any transition which is not `membership=join` -> `membership=leave` should be *hard-failed* immediately at the endpoint; perhaps among additional similar measures TBD.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading matrix-org/matrix-spec-proposals#1383 and the issue's discussion of server ACL handling. Trace the specified behavior of the /send_leave endpoint and compare it with the two proposed solutions. Done means documenting and agreeing on a precise protocol change that lets an ACLed server leave without enabling unauthorized events.

Written by the indexing model from the issue text.

Assessment

Domain
distributed-systems, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.