Skip to content
Snippets Groups Projects
Commit 81bf4b71 authored by 🥺's avatar 🥺 :transgender_flag: Committed by 🥺
Browse files

check user ID server against ACLs for /make_leave

parent b8ec763a
No related branches found
No related tags found
No related merge requests found
...@@ -1302,7 +1302,21 @@ pub(crate) async fn create_leave_event_template_route( ...@@ -1302,7 +1302,21 @@ pub(crate) async fn create_leave_event_template_route(
services() services()
.rooms .rooms
.event_handler .event_handler
.acl_check(sender_servername, &body.room_id)?; .acl_check(origin, &body.room_id)?;
// ACL check invited user server name
services()
.rooms
.event_handler
.acl_check(body.user_id.server_name(), &body.room_id)?;
// check if origin server is trying to send for another server
if body.user_id.server_name() != origin {
return Err(Error::BadRequest(
ErrorKind::InvalidParam,
"Not allowed to leave on behalf of another server/user",
));
}
let room_version_id = services().rooms.state.get_room_version(&body.room_id)?; let room_version_id = services().rooms.state.get_room_version(&body.room_id)?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment