Skip to content

Removing an agent from a room does not stop message delivery - #412

Open
jameshoweee wants to merge 1 commit into
sandbox-quantum:mainfrom
jameshoweee:security/removal-stops-delivery
Open

jameshoweee wants to merge 1 commit into
sandbox-quantum:mainfrom
jameshoweee:security/removal-stops-delivery

Conversation

@jameshoweee

Copy link
Copy Markdown
Contributor

Removing an agent from a room deletes the membership row, but a running client holds its own per-room subscription and keeps receiving everything said in the room. Matrix used to enforce the kick at the homeserver, and that enforcement went away with it.

Same leak on the pull side: poll_events returns everything buffered for the agent with no membership check, unlike its sibling poll_room_events.

Fix: a removal is rung over the invite bus the same way an invitation is, and the transport drops the room's subscription and its cursor. poll_events filters by the rooms the agent is in.

Tests fail before the change and pass after.

Removing an agent from a room deletes the membership row, but a running
client holds its own per-room subscription and keeps receiving everything
said in the room. Matrix used to enforce the kick at the homeserver, and
that enforcement went away with it.

Same leak on the pull side: poll_events returns everything buffered for
the agent with no membership check, unlike its sibling poll_room_events.

A removal is now rung over the invite bus the same way an invitation is,
and the transport drops the room's subscription and its cursor.
poll_events filters by the rooms the agent is in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant