have discovered that the rekeying protocol is vulner-
able to a theoretical unknown key-share (UKS) at-
tack (Blake-Wilson and Menezes, 1999): a malicious
client B, with the help of another client E, can induce
a client A to believe that she (still) shares a secret key
with E, and instead A shares the key with B. The prac-
tical exploitability of this attack in actual implemen-
tations is still to be investigated. Our formalization
covers also the behaviour of the users, when relevant;
e.g., if the users do not check the fingerprints of their
shared keys, a MitM attack is possible.
Vulnerabilities may arise also from the cryp-
tographic primitives, from implementation flaws
(e.g. insufficient checks), from side-channels exfiltra-
tion (such as timing or traffic analysis), or from in-
correct user behaviour. Hence, these aspects deserve
further investigation and particular care in the imple-
mentation and use of this protocol.
In this work, the basic encryption primitive of
MTProto 2.0 has been modeled as a perfect authen-
ticated encryption scheme. Although no attack on
this scheme is known to date, in order to deem MT-
Proto 2.0 secure we need to prove properties such as
IND-CCA and INT-CTXT. This proof cannot be done
in a symbolic model like ProVerif’s, but it can be
achieved in a computational model, using tools like
CryptoVerif or EasyCrypt (Blanchet, 2007; Barthe
et al., 2013)—which we leave to future work. How-
ever, even if a flaw were found in the current encryp-
tion scheme, the results in this paper would still be
valid: the encryption scheme could be replaced with a
stronger one, and no other changes would be required.
Besides automatic tools like ProVerif and Cryp-
toVerif, one may analyse (cryptographic) protocols in
semi-automatic, interactive tools. A prominent exam-
ple is EasyCrypt mentioned above, but there are also
formalisations of the applied π-calculus or even gen-
eral temporal logics in proof assistants like Coq or
Isabelle/HOL (see, e.g. (Kahsai and Miculan, 2008;
Miculan, 2001; Honsell and Miculan, 1995)). In prin-
ciple, these interactive tools allow us to formalize and
prove any properties which can be proved “on the pa-
per”, but the burden on the user is greater than that
induced by automatic tools.
Concerning implementation flaws, our formalisa-
tion can be used as a reference for the correct im-
plementation of MTProto 2.0 clients (and servers).
Tools like Spi2Java or FS2PV can be useful to this end
(Bhargavan et al., 2010; Pozza et al., 2004). Also, par-
ticular attention must be paid to side-channel attacks,
such as on timing or traffic analysis. Another issue
concerning the correct implementation of clients is
that a server can craft malicious DH parameters, e.g.,
choosing generators that make discrete logarithms
significantly easier to compute (Kobeissi et al., 2017)
or choosing non-primes that pass the 15-round Miller-
Rabin test. To prevent the first attack, MTProto pre-
scribes that clients verify that the values received from
the server are valid (see Section 5.3). However, as
far as we can see, MTProto 2.0 still suffers from the
latter vulnerability. A possible improvement is to re-
quire clients to check the proposed primes by means
of deterministic primality algorithms (Agrawal et al.,
2004; Lenstra Jr and Pomerance, 2019).
Correct user behaviour is crucial in order to pre-
vent MitM attacks in secret chats. As we have seen,
users must check the fingerprint of their authorization
keys through an external safe channel; actually, this
issue concerns not only MTProto 2.0 but any protocol
whose keys are defined by means of an insecure
DH exchange. In practice, such checks are likely
often ignored, or performed through the very same
(supposedly secure) chat. Hence, users seriously
concerned about privacy must be educated about the
correct procedure to follow.
REFERENCES
Agrawal, M., Kayal, N., and Saxena, N. (2004). Primes is
in p. Annals of mathematics, pages 781–793.
Barthe, G., Dupressoir, F., Gr
´
egoire, B., Kunz, C., Schmidt,
B., and Strub, P.-Y. (2013). Easycrypt: A tutorial. In
Foundations of security analysis and design VII, pages
146–166. Springer.
Bhargavan, K., Blanchet, B., and Kobeissi, N. (2017). Ver-
ified models and reference implementations for the
TLS 1.3 standard candidate. In IEEE European Sym-
posium on Security and Privacy, pages 483–502.
Bhargavan, K., Fournet, C., and Gordon, A. D. (2010).
Modular verification of security protocol code by typ-
ing. ACM Sigplan Notices, 45(1):445–456.
Blake-Wilson, S. and Menezes, A. (1999). Unknown key-
share attacks on the Station-to-Station (STS) protocol.
In International Workshop on Public Key Cryptogra-
phy, pages 154–170. Springer.
Blanchet, B. (2007). Cryptoverif: Computationally sound
mechanized prover for cryptographic protocols. In
Dagstuhl seminar “Formal Protocol Verification Ap-
plied”, volume 117.
Blanchet, B. (2016). Modeling and verifying security proto-
cols with the Applied Pi Calculus and ProVerif. Foun-
dations and Trends in Privacy and Security, 1:1–135.
Cohn-Gordon, K., Cremers, C., Dowling, B., Garratt, L.,
and Stebila, D. (2017). A formal security analysis
of the Signal messaging protocol. In IEEE European
Symposium on Security and Privacy, pages 451–466.
Dolev, D. and Yao, A. (1983). On the security of public key
protocols. IEEE Transactions on Information Theory,
29(2):198–208.
Frosch, T., Mainka, C., Bader, C., Bergsma, F., Schwenk,
J., and Holz, T. (2016). How secure is textsecure?
SECRYPT 2021 - 18th International Conference on Security and Cryptography
196