From 82bf517a6916cacce46c0e3980f300ab48bb7426 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Wed, 1 Jul 2020 11:53:15 -0700 Subject: [PATCH] onGroupReceived: Only process a group if it has a 16-byte id --- js/background.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/background.js b/js/background.js index c3bd196a8..e37464c5d 100644 --- a/js/background.js +++ b/js/background.js @@ -2116,6 +2116,15 @@ const details = ev.groupDetails; const { id } = details; + const idBuffer = window.Signal.Crypto.fromEncodedBinaryToArrayBuffer(id); + const idBytes = idBuffer.byteLength; + if (idBytes !== 16) { + window.log.error( + `onGroupReceived: Id was ${idBytes} bytes, expected 16 bytes. Dropping group.` + ); + return; + } + const conversation = await ConversationController.getOrCreateAndWait( id, 'group'