question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Users that knock on a room with a shared history visibility and are subsequently kicked are able to view all previous events

See original GitHub issue

Description

I created a room (room version 10) as a test user with the following initial state:

  • history_visibility: shared
  • join_rule: knock

I’m observing that if another user knocks on the room and that admin test user kicks them, the kicked user is still able to fetch all of the previous events of the room using the /_matrix/client/v3/rooms/{roomId}/messages GET endpoint.

This seems like unexpected behaviour to me and a major risk to the privacy/confidentiality of the users in the room.

The Client-Server API Spec mentions this for shared room history visibility:

“Previous events are always accessible to newly joined members. All events in the room are accessible, even those sent when the member was not a part of the room.”

I have a feeling that room members with membership set as knock are mistakenly being considered as newly joined members in this case.

Steps to reproduce

  • the following steps refer to user 1 (room creator and admin) and user 2 (knocker)
  • create a room as user 1 with the following properties:
    • history_visibility: shared
    • join_rule: knock
    • room_version: 10
  • send a few test messages as user 1 in the room
  • knock on the room as user 2
  • kick user 2 as user 1
  • access previous events in the room as user 2 using the /_matrix/client/v3/rooms/{roomId}/messages GET endpoint
  • observe that the test messages sent as user 1 are accessible through this endpoint by user 2

Homeserver

Local test homeserver

Synapse Version

1.68.0

Installation Method

Docker (matrixdotorg/synapse)

Platform

Official Docker image running in a container on Manjaro Linux

Relevant log output

[Edit 2022-09-30 11:41 UTC by dmr: redacted logs which contained sensitive information.]

Anything else that would be useful to know?

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DMRobertsoncommented, Sep 30, 2022

No worries; I merely wanted to err on the side of caution!

0reactions
zamanzamzzcommented, Oct 5, 2022

I have started working on a fix on #14067 and I believe the /_matrix/client/v3/rooms/{roomId}/messages GET endpoint behaves as expected now.

However, I noticed that the shared history is still sent on an initial sync with an include_leave=true filter to users whose membership changed from knock to leave. I’ll try and take a look at that as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client-Server API - Matrix.org
After this call, the client is allowed to see all current state events in the room, and all subsequent events associated with the...
Read more >
Why are invitees unable to book a hotel during registration?
2 Hover over Event Details and, under Travel, click Hotel Accommodations. 3 Click the name of the hotel. The Details tab opens by...
Read more >
THE CRIMINAL INVESTIGATION PROCESS VOLUME III
This finding derives from a combination of observations of police departments made throughout the country and some of the results obtained in the...
Read more >
RANGER HANDBOOK
training be extended to all combat units in the Army.” The Commandant of the Infantry. School was directed to establish a Ranger Department...
Read more >
The Book Thief - SharpSchool
Prior to waking up, the book thief was dreaming about the Führer, Adolf Hitler. ... Mistakes, mistakes, it's all I seem capable of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found