
aims to create a robust basis for a deeper understand-
ing of attacks, facilitating the implementation of more
precise and appropriate security measures. By for-
malizing these descriptions, we intend to enhance the
resilience of systems in the face of threats, thus con-
tributing to the overall improvement of the security
posture. We used a temporal logic formalism known
as Linear Temporal Logic (LTL) for our formaliza-
tion. This article outlines our approach to formalizing
seven common attacks against the MQTT protocol,
creating 12 distinct LTL formulas. Each of these for-
mulas precisely represents a specific attack scenario.
We have classified these attacks into four categories
based on their formulation, where each class is char-
acterized by two distinct property types, φ and ψ. The
number of properties in each formulation varies ac-
cording to the events modeling the attack scenario,
thus presenting an essential key to attack classifica-
tion.
Next, we implemented a set of rules to transform
LTL formulations into TLA+ for verification using
the TLC simulator. When a formula is violated, the
TLC simulator generates a counter-example that mod-
els the execution sequence leading to the violation.
We successfully tested the attack scenarios with iden-
tifiers 2, 3, and 4, except for five message types in at-
tack 2: UNSUBSCRIBE, PUBACK, PUBREC, PUB-
COMP, and DISCONNECT. In addition, we could not
test the attacks on identifiers 1, 5, 6, and 7 due to the
absence of certain functionalities in the MQTT proto-
col specification. This highlights the importance of
updating the existing specification to include these
missing aspects, allowing the verification model to
consider these essential elements. By ensuring that
the specification is updated correctly, we can close
the identified gaps and provide more comprehensive
protection against all classes of potential attacks. By
analyzing the execution traces obtained with TLC, we
have developed a set of patches to improve the speci-
fication.
For future systematic work, it is important to ex-
plore several avenues of research to improve security
verification and extend the study. Firstly, developing
the specification used to cover all the missing attack
scenarios is imperative. Secondly, it is essential to
consolidate all the attack scenarios in a single specifi-
cation code and compare the results obtained.
ACKNOWLEDGEMENTS
The Moroccan-Tunisian Research and Development
project PR&D-19/23: SIGIRO funds the work intro-
duced in this paper. This project aims to monitor wa-
ter reservoirs in water-stressed regions.
REFERENCES
Akhtar, S., Merz, S., and Quinson, M. (2011). A High-
Level Language for Modeling Algorithms and Their
Properties. In Davies, J., Silva, L., and Simao, A., edi-
tors, Formal Methods: Foundations and Applications,
volume 6527, pages 49–63. Springer Berlin Heidel-
berg, Berlin, Heidelberg. Series Title: Lecture Notes
in Computer Science.
Akhtar, S. and Zahoor, E. (2021). Formal Specification and
Verification of MQTT Protocol in PlusCal-2. Wireless
Pers Commun, 119(2):1589–1606.
Baier, C. and Katoen, J.-P. (2008). Principles of model
checking. The MIT Press, Cambridge, Mass. OCLC:
ocn171152628.
CVE (2023). CVE. page https://cve.mitre.org.
Houimli, M., Kahloul, L., and Benaoun, S. (2017). For-
mal specification, verification and evaluation of the
MQTT protocol in the Internet of Things. In 2017
International Conference on Mathematics and Infor-
mation Technology (ICMIT), pages 214–221, Adrar,
Algeria. IEEE.
IoT-Analytics (2023). Iot analytics 2023. pages https://iot–
analytics.com/number–connected–iot–devices/.
Jia, Y., Xing, L., Mao, Y., Zhao, D., Wang, X., Zhao, S.,
and Zhang, Y. (2020). Burglars’ IoT Paradise: Un-
derstanding and Mitigating Security Risks of General
Messaging Protocols on IoT Clouds. In 2020 IEEE
Symposium on Security and Privacy (SP), pages 465–
481, San Francisco, CA, USA. IEEE.
Mosquitto (2018). Eclipse Mosquitto. page
https://mosquitto.org/.
NVD (2023). Nvd,. page https://nvd.nist.gov/.
Stijn, v. W., Chris, M., and KPMG, C. (2017). Formal veri-
fication of the implementation of the mqtt protocol in
iot devices. Amsterdam: University of Amsterdam.
Amsterdam: University of Amsterdam.
Wang, Q., Ji, S., Tian, Y., Zhang, X., Zhao, B., Kan, Y., Lin,
C., Deng, S., Liu, A. X., and Beyah, R. (2021). MPIn-
spector: A Systematic and Automatic Approach for
Evaluating the Security of IoT Messaging Protocols.
30th USENIX Security Symposium.
ENASE 2024 - 19th International Conference on Evaluation of Novel Approaches to Software Engineering
378