This blog post covers “Secure Messaging Authentication against Active Man-in-the-Middle Attacks“: a paper published by Benjamin Dowling and Brita Hale at IEEE Euro S&P 2021 and presented at IACR Real World Crypto 2022 by Hale.
In their work, Dowling and Hale define META: a novel security model which extends the traditional adversary to capture user-mediated authentication protocols. The authors demonstrate the effectiveness of their model by unraveling a realistic authentication vulnerability in the Signal Protocol, when modeled using META. Finally, MoDUSA was proposed as an adaptation to the Signal Protocol to render it secure under the proposed META security model.
Recap on Signal
The Signal Protocol falls under the umbrella of Asynchronous Messaging Protocols. Meaning that it enables end-to-end encryption (E2EE) between senders and recipients even if the latter party would be offline when the very first message is being sent (i.e: when no key agreement protocol has been executed between the parties). This feature is facilitated by a Delivery Service provided by Signal, which stores undelivered messages and PreKeyBundles to be used once for every new conversation. The PreKeyBundles include, among other things, the recipient’s long term public key and their identity, but each contains a unique ephemeral public key to be used for one key-agreement only. Signal users and maintains a queue of undelivered messages. In that case, Alice would request Bob’s public key material from the Delivery Service, execute her part of the Signal Protocol to derive the shared secret, encrypt her message and respond to the Delivery Service with the ciphertext along with the material needed for Bob to perform his part of the protocol. Whenever Bob goes back online, the Delivery Service would relay Alice’s messages to him, enabling him to compute the secret and decrypt Alice’s message.
Ideally, Alice would like to be sure that Bob is the only person who can decrypt her message. However, if the Delivery Service were to be compromised, it could transmit malicious public key material to Alice and claim that it is Bob’s without Alice having any way to refute that claim using the protocol. Alice would be vulnerable to a MiTM attack in this scenario. Additionally, if Bob’s long term key material would be compromised, then Alice would be vulnerable to a Key-Compromise Impersonation attack until Bob revokes his keys from the Delivery Service.

In an attempt to allow users to authenticate each-other out of band without having to trust the Delivery Service, Signal adopted a UI-centred solution in its application with instructions as shown in Figure 1. The idea is that Alice and Bob could compare their “Safety Number” serialised as QR by scanning in-app or by manually comparing a 60-digit representation of it over an alternative mode of communication (ex: in real life, over a different authenticated channel…).
Each party generates the Safety Number as soon as the Signal Protocol is executed successfully. This process meticulously explained in Section 2.3 of the paper. However, in a nutshell, the Safety Number is a concatenation of two fingerprints of long term public keys, one belonging to the local party (Alice) and another to the remote party (Bob). The resulting string is serialised in the QR code, and displayed in a truncated integer representation for convenience. Signal claims that the two parties can be confident that the Distribution Service transmitted the correct key for the other party when a match is obtain during comparison. This would make sense, since each party inputs their own key in the algorithm as well as the one provided by the Distribution Service.
Identified Weaknesses
No ‘per epoch’ authentication
If an active attacker compromises a user’s long term private key, then they would be able to impersonate the user during conversations and even regenerate the fingerprint required to generate the Safety Number. In that case, even out-of-band authentication would not be effective. Moreover, the Safety Number is generated only when the key exchange takes place, and is produced using information that is public and static.
Vulnerability against a Display Overlay Attack
The traditional attacker models do not usually consider device compromises with limited impact. An example of that could be a Display Overlay Attack. The attacker in this case would be able to manipulate the display of a client device, by displaying an overlay (think android adware) over the Signal Safety Number verification UI to cover the original QR code with maliciously crafted one, allowing out-of-band authentication during compromise. In this case, no access to secret key material would be required to perform the attack.
Contributions
The Mediated Epoch Three-party Authentication Security (META) Framework

In Figure 2, we can find the Device-to-Device Channel which is used traditionally when analysing protocols. What META proposes is an extension to this model which considers the User-to-Device Channel.

Figure 3 demonstrates the proposed attacker capabilities API, allowing the possibility to parameterise granular scenarios to capture an attacker which can compromise a user without compromising a device or vice versa.
This would allow us to model and analyse an attacker capable of executing a Display Overlay Attack, but not accessing any secret state as previously discussed.
Modified Device-to-User Signal Authentication (MoDUSA)

source: presenter slides
Signal employs a Double Ratchet algorithm which refreshes symmetric keys used to encrypt messages per epoch.
To patch the authentication vulnerability presented, the authors suggest leveraging the Double Ratchet by maintaining a hash of ratchet values until the point of comparison of Security Numbers.
The result would be a different Secret Number for every epoch, as opposed to a new one for every key exchange operation which is rarer to occur in general. It’s important to note however that the Safety Number could be generated efficiently at the moment of comparison rather than at every epoch by using the hash from the previous epoch.
This contribution allows Key-Compromise Impersonation detection as the Secret number would no longer be depending on static public key material exclusively. It also reduces the attacker’s ability to deploy a Display Overlay Attack without having access to secret key material.
Conclusion
The META framework proposed by Dowling and Hale provides a novel approach to protocol analysis and security modelling. The attack found on Signal, one of the most popular E2EE protocols/services, shows great promise for this method of analysis.
MoDUSA is a clean extension to Signal which enhances authentication properties and protects against certain cases of Key-Compromise Impersonation and Display Overlay Attacks. However, it is not clear at the moment whether the addition has any impact on Signal’s deniability properties. MoDUSA was an inspiration for “Continuous authentication in Secure Messaging“: a method to authenticate parties without the need for an Out-of-Band Channel. This was also presented by Alexandre Poirrier at Real World Crypto 2022.


