mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
Prevent injecting a forged encrypted message and using session_id/sender_key of another room.
This commit is contained in:
parent
28a3ae264c
commit
d6358dcb16
1 changed files with 3 additions and 0 deletions
|
@ -1354,6 +1354,9 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
senderKey = sessionInfoPair.second,
|
||||
sharedHistory = true
|
||||
)
|
||||
}?.filter { inboundGroupSession ->
|
||||
// Prevent injecting a forged encrypted message and using session_id/sender_key of another room.
|
||||
inboundGroupSession.roomId == roomId
|
||||
}?.forEach { inboundGroupSession ->
|
||||
// Share the sharable session to userId with deviceId
|
||||
val exportedKeys = inboundGroupSession.exportKeys(sharedHistory = true)
|
||||
|
|
Loading…
Reference in a new issue