Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref(lobby): check that a lobby notification comes from a moderator. (#17760)

bgrozev188a592e144c
diff --git a/react/features/lobby/middleware.ts b/react/features/lobby/middleware.ts
index eed1a896b1..f82cc95397 100644
--- a/react/features/lobby/middleware.ts
+++ b/react/features/lobby/middleware.ts
@@ -69,6 +69,7 @@ import {
import { updateLobbyParticipantOnLeave } from './actions.any';
import { KNOCKING_PARTICIPANT_SOUND_ID } from './constants';
import { getKnockingParticipants, showLobbyChatButton } from './functions';
+import logger from './logger';
import { KNOCKING_PARTICIPANT_FILE } from './sounds';
import { IKnockingParticipant } from './types';
@@ -408,6 +409,15 @@ function _maybeSendLobbyNotification(origin: any, message: any, { dispatch, getS
return;
}
+ // Prosody sends this notification with the moderator which performed the action as the sender, and only a
+ // moderator can enable or disable the lobby, or admit or reject a participant. Check the role, so that the
+ // client shows a notification only for an action which the sender is able to perform.
+ if (!origin.isModerator?.()) {
+ logger.warn(`Ignoring a lobby notification from a non-moderator: ${origin._id}`);
+
+ return;
+ }
+
const notificationProps: INotificationProps = {
descriptionArguments: {
originParticipantName: getParticipantDisplayName(getState, origin._id),