fix: SEC26

Reviewed-By: timedout <git@nexy7574.co.uk>
Reviewed-By: Ginger <ginger@gingershaped.computer>
This commit is contained in:
Ginger committed 2026-08-11 17:56:29 -04:00
1 parent 7377074f6d
commit ad182417da
4 files changed
+35 -16

No files matched your search

+12 -1
View File
@@ -1,7 +1,7 @@
use std::{borrow::Borrow, iter::once};
use axum::extract::State;
use conduwuit::{Err, Result, at, err, info};
use conduwuit::{Err, Event, Result, at, err, info};
use futures::{StreamExt, TryStreamExt};
use ruma::{OwnedEventId, api::federation::event::get_room_state_ids};
@@ -25,6 +25,17 @@ pub(crate) async fn get_room_state_ids_route(
.assert()
.await?;
// The event must be in the room we just authorised access to
if !services
.rooms
.timeline
.get_pdu(&body.event_id)
.await
.is_ok_and(|pdu| pdu.room_id_or_hash() == body.room_id)
{
return Err!(Request(NotFound("Event not found.")));
}
if services
.rooms
.pdu_metadata