Fuzzing Radio Resource Control Messages in 5G and LTE Systems
Total Page:16
File Type:pdf, Size:1020Kb
DEGREE PROJECT IN COMPUTER SCIENCE AND ENGINEERING, SECOND CYCLE, 30 CREDITS STOCKHOLM, SWEDEN 2021 Fuzzing Radio Resource Control messages in 5G and LTE systems To test telecommunication systems with ASN.1 grammar rules based adaptive fuzzer SRINATH POTNURU KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE Fuzzing Radio Resource Control messages in 5G and LTE systems To test telecommunication systems with ASN.1 grammar rules based adaptive fuzzer SRINATH POTNURU Master’s in Computer Science and Engineering with specialization in ICT Innovation, 120 credits Date: February 15, 2021 Host Supervisor: Prajwol Kumar Nakarmi KTH Supervisor: Ezzeldin Zaki Examiner: György Dán School of Electrical Engineering and Computer Science Host company: Ericsson AB Swedish title: Fuzzing Radio Resource Control-meddelanden i 5G- och LTE-system Fuzzing Radio Resource Control messages in 5G and LTE systems / Fuzzing Radio Resource Control-meddelanden i 5G- och LTE-system © 2021 Srinath Potnuru iii Abstract 5G telecommunication systems must be ultra-reliable to meet the needs of the next evolution in communication. The systems deployed must be thoroughly tested and must conform to their standards. Software and network protocols are commonly tested with techniques like fuzzing, penetration testing, code review, conformance testing. With fuzzing, testers can send crafted inputs to monitor the System Under Test (SUT) for a response. 3GPP, the standardiza- tion body for the telecom system, produces new versions of specifications as part of continuously evolving features and enhancements. This leads to many versions of specifications for a network protocol like Radio Resource Control (RRC), and testers need to constantly update the testing tools and the testing environment. In this work, it is shown that by using the generic nature of RRC specifications, which are given in Abstract Syntax Notation One (ASN.1) de- scription language, one can design a testing tool to adapt to all versions of 3GPP specifications. This thesis work introduces an ASN.1 based adaptive fuzzer that can be used for testing RRC and other network protocols based on ASN.1 description language. The fuzzer extracts knowledge about ongoing RRC messages using protocol description files of RRC, i.e., RRC ASN.1 schema from 3GPP, and uses the knowledge to fuzz RRC messages. The adaptive fuzzer identifies indi- vidual fields, sub-messages, and custom data types according to specifications when mutating the content of existing messages. Furthermore, the adaptive fuzzer has identified a previously unidentified vulnerability in Evolved Packet Core (EPC) of srsLTE and openLTE, two open-source LTE implementations, confirming the applicability to robustness testing of RRC and other network protocols. Keywords: RRC, 5G NR, robustness testing, fuzzing, ASN.1, network pro- tocol testing, vulnerability detection, software security iv Sammanfattning 5G-telekommunikationssystem måste vara extremt tillförlitliga för att möta be- hoven för den kommande utvecklingen inom kommunikation. Systemen som används måste testas noggrant och måste överensstämma med deras standar- der. Programvara och nätverksprotokoll testas ofta med tekniker som fuzzing, penetrationstest, kodgranskning, testning av överensstämmelse. Med fuzzing kan testare skicka utformade input för att övervaka System Under Test (SUT) för ett svar. 3GPP, standardiseringsorganet för telekomsystemet, producerar ofta nya versioner av specifikationer för att möta kraven och bristerna från tidigare utgåvor. Detta leder till många versioner av specifikationer för ett nät- verksprotokoll som Radio Resource Control (RRC) och testare behöver stän- digt uppdatera testverktygen och testmiljön. I detta arbete visar vi att genom att använda den generiska karaktären av RRC-specifikationer, som ges i be- skrivningsspråket Abstract Syntax Notation One (ASN.1), kan man designa ett testverktyg för att anpassa sig till alla versioner av 3GPP-specifikationer. Detta uppsatsarbete introducerar en ASN.1-baserad adaptiv fuzzer som kan användas för att testa RRC och andra nätverksprotokoll baserat på ASN.1- beskrivningsspråk. Fuzzer extraherar kunskap om pågående RRC meddelan- den med användning av protokollbeskrivningsfiler för RRC, dvs RRC ASN.1 schema från 3GPP, och använder kunskapen för att fuzz RRC meddelanden. Den adaptiva fuzzer identifierar enskilda fält, delmeddelanden och anpassade datatyper enligt specifikationer när innehållet i befintliga meddelanden mu- teras. Dessutom har den adaptiva fuzzer identifierat en tidigare oidentifierad sårbarhet i Evolved Packet Core (EPC) för srsLTE och openLTE, två open- source LTE-implementeringar, vilket bekräftar tillämpligheten för robusthets- provning av RRC och andra nätverksprotokoll. Nyckelord: RRC, 5G NR, robusthetstest, fuzzing, ASN.1, nätverksproto- kolltestning, sårbarhetsdetektering, mjukvarusäkerhet Acknowledgments v Acknowledgments I am grateful for the opportunity provided by the host company Ericsson AB, my manager Hans Eriksson, and my supervisor Prajwol Kumar Nakarmi for trusting me to carry out this project. The guidance and support provided by Prajwol helped me identify many challenges and solutions along the way. His immense knowledge in security and radio access solutions made it easy for me to carry out the thesis work. I would also like to thank my KTH supervisor Ezzeldin Zaki and my exam- iner Dr. György Dán who helped me frame the research question and provided valuable inputs throughout my thesis. I thank all the open-source communi- ties and forums which gave enough support for many of my questions. Lastly, I would like to extend my gratitude towards my closest friends and family who stood by me throughout the period of this thesis. Stockholm, February 2021 Srinath Potnuru Contents List of Figures . .x List of Tables . xi List of Acronyms and Abbreviations . xvi 1 Introduction 1 1.1 Background . .1 1.2 Problem description . .3 1.3 Contribution . .4 1.4 Goals . .4 1.5 Ethical and Sustainability Aspects . .4 1.6 Method . .5 1.7 Stakeholders . .5 1.8 Delimitations . .6 1.9 Outline . .6 2 Background 7 2.1 Introduction to 5G . .7 2.1.1 5G Architecture . .9 2.2 5G New Radio . 10 2.3 Radio Resource Control (RRC) . 16 2.3.1 RRC State Machine . 17 2.3.2 Messages in RRC . 18 2.4 ASN.1 . 19 2.5 Fuzzing . 21 2.6 Related Work . 23 2.7 RRC and Fuzzing . 25 2.8 Similarities between 5G and LTE . 26 2.9 Summary . 28 vii viii CONTENTS 3 Design and Methodology 29 3.1 Design Requirements . 29 3.2 The adaptive fuzzer . 29 3.2.1 Fuzzer . 31 3.2.2 Observer . 32 3.3 Summary . 33 4 Implementation 34 4.1 Fuzzer . 34 4.1.1 Fuzzing Strategies . 36 4.2 Observer . 40 4.3 Summary . 43 5 Evaluation 44 5.1 Evaluation tools . 44 5.2 Integrating adaptive fuzzer with srsLTE . 45 5.3 Identifying testing strategies . 46 5.4 Collecting Results . 48 5.5 Filtering out false positives . 51 5.6 Summary . 52 6 Results and Analysis 53 6.1 Results . 53 6.2 Crash in EPC . 56 6.3 Impact on performance of srsLTE due to fuzzing . 57 6.4 Summary . 58 7 Conclusions and Future Work 59 7.1 Conclusions . 59 7.2 Future Work . 60 References 62 List of Figures 1.1 Minimalistic view of 5G system. .2 2.1 Use case categorization triangle in 5G by ITU-T. .8 2.2 Overview of 5G communication system. .9 2.3 Service Based Architecture with different network functions in 5G system. 10 2.4 Networking layers involved in 5G control plane messages. 11 2.5 Networking layers involved in 5G user plane messages. 12 2.6 Mapping between logical, transport and physical channels in the downlink [19]. 13 2.7 Mapping between logical, transport and physical channels in the uplink [19]. 14 2.8 RRC State Machine in 5G NR [25]. 17 2.9 ASN.1 language structure for RRCConnectionRequest in EU- TRA TS 36.331 v15.4. 19 2.10 Example tree fashion ASN.1 structure of an RRC Message. 20 2.11 General fuzzing framework. 22 2.12 Networking layers involved in 5G and LTE control plane mes- sages. 26 2.13 srsLTE nodes no RF front-end. 28 3.1 Adaptive fuzzing framework for an ASN.1 based network pro- tocol. 30 3.2 RRC State Machine in EUTRA [49]. 33 4.1 Components of the mutation based adaptive fuzzer. 36 4.2 ASN.1 description of DedicatedInfoNAS in 3GPP TS [49]. 36 4.3 Wireshark packet capture of UECapabilityInformation gener- ated by srsUE (UE implementation in srsLTE). 39 ix x LIST OF FIGURES 4.4 Wireshark packet capture of UECapabilityInformation with fuzz_append_string set to true.................. 40 5.1 Integrating the adaptive fuzzer with srsLTE. 46 5.2 RRC messages sent between UE and network during initial activation in 5G and LTE system. 47 5.3 Automated toolchain for continuous testing (dashed lines in- dicate fuzzing during initial AS activation). 50 5.4 Flowchart for replaying RRC messages to verify a TRUE crash (dashed lines indicate fuzzing in initial AS activation). 51 6.1 Boxplot distribution of measured latency for 44,383 fuzzed uplink RRC messages. 57 List of Tables 2.1 Names and Abbreviations of Physical Channels in 5G NR [18] 13 2.2 Names and Abbreviations of Transport Channels in 5G NR [18] 15 2.3 Names and Abbreviations of Logical Channels in 5G NR [18] 15 5.1 Different fuzzing strategies identified for RRC messages in srsLTE . 49 6.1 Number of RRC messages from srsLTE fuzzed by the adaptive fuzzer and the range of seed values used . 56 xi xii List of Acronyms and Abbreviations List of Acronyms and Abbreviations 3G Third Generation Telecommunication System 3GPP 3rd Generation Partnership Project 5G Fifth Generation Telecommunication System 5G NR Fifth