Skip to content
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

C2S API allows illegal ban -> kick, which causes an implicit unban #655

Open
nexy7574 opened this issue Jan 5, 2025 · 3 comments
Open

Comments

@nexy7574
Copy link
Contributor

nexy7574 commented Jan 5, 2025

While performing some moderation with Draupnir, I noticed that it managed to unban a user while I was doing a mass kick. After reporting this to the Draupnir team, they informed me that this was an issue with the server as the bot does not check membership before and simply calls the /rooms/:room_id/kick endpoint.

I tested this behaviour (banning, then kicking) on both the latest Synapse, and the latest Dendrite, and both returned a 403 error for the kick. Furthermore, the issue was queried in the matrix spec room, which added that the spec doc for /kick states 403 should be returned when:

403: You do not have permission to kick the user from the room. A meaningful errcode and description error text will be returned. Example reasons for rejections are:

The kicker is not currently in the room.
The kickee is not currently in the room.
The kicker’s power level is insufficient to kick users from the room.

However, this behaviour is not correctly followed in conduwuit. A kick following a ban will update the ban membership state to a leave membership state, which implicitly unbans the banned user.

@girlbossceo
Copy link
Owner

probably an upstream ruma bug really, but can just be fixed in conduwuit

@nexy7574
Copy link
Contributor Author

nexy7574 commented Jan 5, 2025

Yeah can confirm, the same behaviour is present in conduit and other forks.

@nexy7574
Copy link
Contributor Author

nexy7574 commented Jan 7, 2025

This issue has been fixed in Draupnir devel, so I'm going to close this issue and instead file it with ruma. The issue does still technically apply though so feel free to open it if you feel it's still relevant,

@nexy7574 nexy7574 closed this as completed Jan 7, 2025
@girlbossceo girlbossceo reopened this Jan 7, 2025
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

No branches or pull requests

2 participants