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

fix!: Only room creator can set the E2EE room key for the first time #33520

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/soft-planets-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": major
---

Fixes a behavior of E2EE room creation that allowed any user on the room to define room keys before the room creator, causing race conditions.
4 changes: 2 additions & 2 deletions apps/meteor/app/e2e/client/rocketchat.e2e.room.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ export class E2ERoom extends Emitter {

try {
const room = ChatRoom.findOne({ _id: this.roomId });
if (!room.e2eKeyId) {
// TODO CHECK_PERMISSION
// Only room creator can set keys for room
if (!room.e2eKeyId && room.u._id === this.userId) {
this.setState(E2ERoomState.CREATING_KEYS);
await this.createGroupKey();
this.setState(E2ERoomState.READY);
Expand Down
Loading