futureinternet-16-00001-v2
futureinternet-16-00001-v2
Article
A Vulnerability Assessment of Open-Source Implementations of
Fifth-Generation Core Network Functions
Filippo Dolente, Rosario Giuseppe Garroppo and Michele Pagano *
Department of Information Engineering, University of Pisa, Via Girolamo Caruso, 16, 56122 Pisa, Italy;
[email protected] (F.D.); [email protected] (R.G.G.)
* Correspondence: [email protected]
Abstract: The paper presents an experimental security assessment within two widely used open-
source 5G projects, namely Open5GS and OAI (Open-Air Interface). The examination concentrates on
two network functions (NFs) that are externally exposed within the core network architecture, i.e., the
Access and Mobility Management Function (AMF) and the Network Repository Function/Network
Exposure Function (NRF/NEF) of the Service-Based Architecture (SBA). Focusing on the Service-
Based Interface (SBI) of these exposed NFs, the analysis not only identifies potential security gaps
but also underscores the crucial role of Mobile Network Operators (MNOs) in implementing robust
security measures. Furthermore, given the shift towards Network Function Virtualization (NFV),
this paper emphasizes the importance of secure development practices to enhance the integrity of 5G
network functions. In essence, this paper underscores the significance of scrutinizing security vulner-
abilities in open-source 5G projects, particularly within the core network’s SBI and externally exposed
NFs. The research outcomes provide valuable insights for MNOs, enabling them to establish effective
security measures and promote secure development practices to safeguard the integrity of 5G network
functions. Additionally, the empirical investigation aids in identifying potential vulnerabilities in
open-source 5G projects, paving the way for future enhancements and standard releases.
2. Related Work
To gain a comprehensive understanding of the security threats in 5G networks, it is
essential to consider recent survey papers that provide an overview of various aspects of
5G security. For example, Nencioni et al. [7] offer an analysis of 5G-MEC architecture and
its security implications, which is crucial in understanding the security challenges in 5G
networks. Bozorgchenani et al. [8] highlight the introduction of new security challenges
in 5G due to the utilization of enabling technologies and the high degree of network
heterogeneity. This is important in understanding the evolving nature of security threats
in 5G networks. Additionally, Salazar et al. [9] discuss the new cybersecurity threats
introduced by 5G SBA, emphasizing the ineffectiveness of previously adopted security and
privacy mechanisms in the context of 5G. Mahyoub et al. [10] present a detailed 5G security
analysis from the perspective of network architecture. They closely examine the critical 5G
interfaces and provide a set of possible vulnerabilities and threats that would occur if no
proper security mechanisms were set in place.
Considering commercial networks, there are works such as Park et al. (2021) [11]
that analyze if the mobile operators provide 5G services applying techniques of reaction
related to security threats. Their analysis lists the security challenges that are valid in the
real 5G NSA (non-stand-alone) network and how they could be mitigated. However, the
considered NSA networks are based on the Evolved Packet Core (EPC) architecture, and
the identified vulnerabilities are related to the elements of the EPC architecture.
In their study on 5G architecture, Park et al. (2022) [12] propose a 5G security system
to ensure security within the 5G core network. They evaluate the performance and security
features in real time, focusing on interfaces used in NAS, HTTP, PFCP, and GTP protocols.
The authors introduce an effective detection algorithm for PFCP-in-GTP and IPsec disable
attacks, representative of 5G vulnerability attacks. Tests were conducted using a commercial
5G core network system simulator.
The formal verification of 5G network protocols has been approached through var-
ious models. Basin et al. [13] model the Authentication and Key Agreement Protocols
(5G-AKA) of 5GS, while Hussain et al. [14] analyze several NAS and RRC protocols.
Yang et al. [15] present a formal model of the Authentication and Key Management for
Application (AKMA) service used for establishing authenticated communication between
users and application functions. Akon et al. [16] recently introduced the first scalable
formal model of the 5G core network’s access control mechanism. The proposed 5GCVerif
is an adversary-controlled framework designed for the systematic formal analysis of the
access control mechanism of the 5G core network, revealing five new classes of exploitable
privilege escalation vulnerabilities in the technical specifications.
Conversely, numerous fuzzers have been developed in the past to identify new vul-
nerabilities. The National Computing Centre (NCC) group introduces three representative
tools: Fuzzowski 5GC, Frizzer2, and AFLNet. Among them, Frizzer2 and AFLNet are
open-source network protocol fuzzers accessible to anyone [17]. The group examines two
open-source solutions, Free5GC and Open5GS, with the latter chosen for its stability and
ease of installation. While neither of these solutions is of commercial grade, they provide a
reasonable test target for free.
Future Internet 2024, 16, 1 4 of 24
Salazar et al. [18] propose several scenarios to simulate attack injection using the
open-source simulator 5Greplay [19]. These scenarios include modifying and injecting
network traffic offline, sending malformed packets against open-source 5G cores in real
time, and conducting a NAS-5G Security Mode Command (SMC) replay attack. The last
use case involves generating high-bandwidth traffic to validate the scalability of 5Greplay.
5Greplay can be considered a classical traffic replay tool when inputting a PCAP file.
However, it distinguishes itself from classical traffic replay tools due to its ability to modify
5G protocols, such as NAS-5G and Next Generation Application Protocol (NGAP). Users
can modify attributes in a completely arbitrary manner. Dumitru-Guzu et al. [20] deploy
the Open5GS core as microservices orchestrated by Kubernetes to simulate two attack
scenarios on the control and user plane. The simulation involves injecting traffic using the
5Greplay tool to analyze the AMF throughput response under the two attack scenarios.
3. Background on 5G System
This section is organized in two parts: the first one presents the architecture of the
network, while the second one focuses on communication aspects between the NFs.
The RAN is a mesh network of gNodeBs (gNBs), which facilitates wireless connectivity
for 5G users to 5GC via the Uu air interface. The gNodeB engages with the UE through
New Radio Radio Resource Control (NR RRC) protocols in the control plane (CP) and
forwards traffic data to the user plane function (UPF) in the user plane (UP). Additionally,
it establishes a relay bridge for the transmission of non-access stratum (NAS) messages
between the UE and the AMF, to manage the establishment of communication sessions and
to maintain continuous communications with the UE as it moves.
UE denotes the mobile equipment (ME) equipped with a Subscriber Identity Module
(SIM). The ME, typically represented by smartphones, serves as a cellular device capable of
establishing connections with gNB. The SIM can take the form of a physical Universal SIM
Future Internet 2024, 16, 1 5 of 24
(USIM) or a virtual eSIM. It stores subscriber data identical to that found in the operator’s
Unified Data Management (UDM) database, including the globally unique Subscriber
Permanent Identity (SUPI), cryptographic keys, and security algorithms.
The 5GC incorporates an array of NFs, each serving distinct roles. Noteworthy, on the
control plane among these are the following:
• The Network Exposure Function (NEF) facilitates the exposure of NF functionality
externally, fostering interaction with third-party applications.
• AMF orchestrates access control and mobility management.
• The Network Slice Selection Function (NSSF) facilitates the selection of network slices
for user-requested services.
• The Session Management Function (SMF) is responsible for session setup and man-
agement in alignment with network policies.
• The Policy-Control Function (PCF) provides policy management capabilities.
• UDM stores subscriber data and profiles.
• The NF Repository Function (NRF) enables registration and discovery of NFs for
interfunction communication.
• The Authentication Server Function (AUSF) is responsible for user authentication.
On the data plane, only UPF provides all the functions necessary for user packet
routing and forwarding. UPF corresponds to the gateway concept in 4G, interfacing the 5G
systems with the external data networks.
Of note, NEF and NRF functions stand as noteworthy additions in the 5GC compared
to the 4G EPC. Although both fulfill similar roles, NEF targets external network exposure,
while NRF serves internal 5GC functions.
the RAN, as shown by the Open Radio Access Network (O-RAN) Alliance [26]. This
signifies the convergence of open-source and cloud-native principles in 5G deployment,
distinguishing it as the pioneer in this domain.
The interaction among NFs in 5GC is characterized by a “producer–consumer” relation-
ship. This relationship promotes dynamic collaboration, facilitating the smooth exchange
of services between functions and thereby enhancing the overall network efficiency.
Within the orchestration of NFs in the 5GC, a dynamic model emerges in which each
NF serves as both a “producer” and a “consumer” of services. This dynamic interaction
model is based on “request” and “subscribe” interactions, providing flexibility and adapt-
ability to the system. Figure 2 shows an example of an API call involving NRF. The example
refers to the API-driven interaction for session establishment. The SMF discovery and
Session Establishment are initiated by the AMF, serving as a key instance of the interac-
tion flow. The NRF plays a pivotal role in facilitating SMF discovery, thereby exemplifying
the essence of API-driven communication in SBA.
4. Security in 5G Infrastructure
The adoption of 5G technology brings opportunities across automotive, industrial, and
business sectors, fostering IoT integration and productivity gains. However, this integration
exposes 5G networks to unique security vulnerabilities. Addressing these risks is crucial
for network safeguarding and threat prevention. An assault on a 5G network carries more
profound consequences than on 4G or earlier networks. This arises from the intricate 5G
network structure and its pivotal role in critical industries.
The 5G security framework encompasses defense against multiple threats: radio
access, signaling planes, user planes, impersonation, confidentiality breaches, replay at-
tacks, downgrades, man-in-the-middle intrusions, and interoperator security issues. These
concerns were meticulously considered during the 5G design and deployment [27].
This section presents a concise overview of the security mechanisms in 5G systems. It
includes a brief description of the protection mechanisms adopted in 5G, highlighting their
improvements over 4G, as well as an outline of the major vulnerabilities associated with
core network elements.
Future Internet 2024, 16, 1 7 of 24
Distributed DoS (DDoS) attacks, and replay attacks are potential threats; therefore, in our
experimental testbeds, we will verify their impact on AMF and NRF/NEF in two popular
5G open-source projects.
The 5G landscape incorporates APIs and exposes the core to third parties, with the
Common API Framework (CAPIF) introduced in Release 15 and expanded in Release 16.
CAPIF establishes a consistent northbound API framework for diverse 3GPP functions.
This framework encompasses the API Exposing Function, API Publishing Function, and
API Management Function.
Any SIM card contains an International Mobile Subscriber Identity (IMSI) uniquely
identifying a subscriber in the operator’s network. The IMSI, comprising 15/16 digits, was
sent in clear text during NAS procedures in the past mobile generation. This feature has
been exploited to perform the tracking of users’ location and violate the users’ privacy.
In 4G, the generation of a Globally Unique Temporary ID (GUTI) avoids one sending
IMSI in the clear. However, the development of IMSI catcher techniques allows to overcome
the barrier added by the temporary identifier [30]. In 5G, to contrast this issue, privacy
starts preauthentication via encrypting the SUPI using the home network public key in the
USIM, generating the Subscription Concealed Identifier (SUCI). This approach mitigates the
exposure of subscriber identity during transmission [27]. However, it does not completely
prevent all tracking and linking. In scenarios where a user’s identity is already known,
an attacker can still probe users for that identity, as exemplified by the SUCI-Catcher
attack [31]. Furthermore, the recent analysis of public mobile networks shows that the
SUCI mechanism is not deployed [32,33].
Two types of SUPI are defined: the Network Specific Identifier (NSI) and the IMSI [34].
In the first case, the unique identifier is composed of a variable-length username and
domain name (e.g., [email protected]). In the second case, the SUPI
consists of a 3-digit Mobile Country Code (MCC), a 2–3-digit Mobile Network Code (MNC),
and a 10–11-digit Mobile Subscriber Identification Number (MSIN). The SUCI always
contains the SUPI type (e.g., IMSI, NSI), Home Network Identifier, Routing Indicator,
Protection Scheme, Home Network Public Key ID, and Protection Scheme Output.
The Home Network Identifier contains the domain name of the NSI SUPI, while
consisting of MCC and MNC in the case of the IMSI. The Protection Scheme Output
completes the SUPI by reporting the username part of NSI SUPI, or the mobile subscriber
identification number (MSIN) of the IMSI.
Although not considered in our testbeds, it is worth mentioning that other than
mobility, roaming is a distinctive feature of mobile networks. The fifth-generation system
introduces Security Edge Proxy Protection (SEPP) for roaming interconnection, which
ensures secure communication between home network and serving network. Two Internet
Protocol Exchanges (IPXs) are established between the Visited and the Home Public Land
Mobile Networks (VPLMN and HPLMN, respectively), and SEPP implements application
layer security, preventing IPX providers from reading sensitive data. It detects unauthorized
message modifications and performs source validation, message format verification, and
topology hiding [27]. Communication between SEPPs uses HTTP/2 protocol via well-
defined API requests, so our testing methodology (see, in particular, Section 5.4) could be
easily extended to SEPP.
Finally, for non-3GPP access networks, 3GPP has considered two access scenarios:
trusted and untrusted. In the trusted scenario, traffic is exchanged with the trusted non-
3GPP access using the Trusted Non-3GPP Gateway Function (TNGF). In the case of un-
trusted non-3GPP networks, the Non-3GPP Interworking Function (N3IWF) acts as a
security gateway, enabling the UE to access the 5G core over untrusted non-3GPP networks
through IPsec tunnels for both UP and CP traffic [35].
Future Internet 2024, 16, 1 9 of 24
User Equipment Air Interface RAN MEC 5G Packet Core N6 and Roaming
Note that the wide use of distributed computing architectures like Multiaccess Edge
Computing (MEC) to improve the end-user experience or application performance intro-
duces new concerns in terms of security. Indeed, MEC connections to core 5G could allow
attacks exploiting weak implementations within MEC to establish indirect connections to
core 5G, leading to API injection. Proper Transport Layer Security (TLS) usage, as mandated
by 3GPP, can mitigate this problem, although challenges persist in TLS management and
implementation [43].
Furthermore, encrypted container communication hampers network security controls,
necessitating anomaly-based Intrusion Detection Systems (IDSs) (possibly based on AI and
ML [44]) to analyze encrypted packets without decryption and detect malicious packets
(with all the limitations related to false positives and false negatives).
For MEC applications, API gateways or API firewalls are advised, along with adher-
ence to established API security protocols to counter API attacks.
5. Experimental Methodology
Our work focuses on the security aspects related to the NFs that are exposed to the
outside of 5GC, either directly or indirectly, such as the AMF (considering both the N1
interface with the UE, through the NAS, and the N2 interface) and the NRF/NEF, which acts
as an API gateway between the 5GC and third-party applications, to offer services outside
the 5G network. At first, our investigation is centered on the evaluation of the reliability and
security posture of the AMF component within the 5GC. Specifically, our goals encompass
the identification of vulnerabilities related to replay attacks and DoS attacks. Then we
test the effectiveness of security measures implemented in the NRF/NEF, focusing on
DoS attacks and API injection techniques, which are common in web application security.
Future Internet 2024, 16, 1 11 of 24
While the analysis of the NEF component is restricted due to the absence of open-source
implementations at the time of this study, we leverage simulations and tests on the NRF to
gain insights into the security landscape of the SBI. In more detail we aim to scrutinize the
vulnerability landscape by examining the OWASP Top 10 vulnerabilities and assessing their
applicability to 5GC, considering its unique communication methodologies, particularly via
REST API requests. Furthermore, we explore scenarios involving communication between
different operators’ NRFs, leading to considerations of potential malicious actions that
might compromise competitors’ 5GC infrastructures.
OAI Open5GS
Version used 1.4.0 v2.4.11-17
Deployment mode supported VM, Container, Kubernets VM, Container, Kubernets
Protocols supported in SBI HTTP/1.1 and HTTP/2 HTTP/2
TLS in SBI No No
Declared compliance
Release 16 Release 16
3GPP standard
Different deployment Yes, configuration to be
Yes, with script
modes supported performed manually
Yes, Configuration on AMF
Configuration needed before run No
and UPF
API Adherence to the 3GPP Rel
Partial Partial
16 Standard
For both NFs, the DoS attack has been tested using a free and open-source tool,
MHDDoS [46], which allows us to determine the behavior of these NFs under heavy loads.
As concerns the AMF, we emulate a replay attack utilizing the 5Greplay tool [19]. The
goal of this test is to assess AMF resilience to the reply of registration messages from the
UE. Finally, leveraging the Burp Suite tool [47] (and the ad hoc 5GHTTP modifier tool
for the Open5GS testbed), we perform the API injection test on the NRF by examining the
OWASP Top 10 vulnerabilities. The 5GHTTP modifier tool, configuration files and some
acquired data of the presented analysis are available in [6].
The rest of this section presents in detail all the above-mentioned specific attack
scenarios. Then, the experimental results will be reported in the following sections.
has been completed with a multitude of different source port numbers and the connections
are in the established state.
The effectiveness of the attack can be magnified by harnessing a network of compro-
mised devices (botnets) distributed across various locations.
It is essential to highlight that the AMF encompasses two distinct types of interfaces.
The first type comprises interfaces linked to the 5G access network, exemplified by N1 and
N2. These interfaces employ a protocol stack that concludes with the NAS protocol and
may utilize suitable transport protocols for control plane traffic, such as SCTP implemented
on the N2 interface. The second type is the SBI, establishing connections between the AMF
and other NFs of the SBA, including NRF, UDM, and PCF. This interface employs TCP to
facilitate the RESTful communication model integral to the SBI.
To mount this TCP ACK flooding attack, we employ MHDDoS with the specific
configuration parameters reported in Table 3.
It is important to highlight two notable limitations inherent to this test. Indeed, the
absence of a multitude of machines for simultaneous DDoS attack execution and the lack
of active users within the network who might experience disruptions constrain the scope
of our experimentation. Thus, our evaluation extends primarily to augmenting requests to
the NF and assessing its responsiveness in relation to other interfaces within the SBI. Our
assessment delves into whether the NF can continue to receive messages from other NFs
and fulfill API requests under the duress of the attack.
Figure 3. UE authentication procedure: The messages exchanged between UE and AMF during the
identification, authentication, and SMC procedure.
Preceding the establishment of the security context, NAS messages are transmitted in
an unencrypted state. This vulnerability emerges from the potential interception of a clear
NAS Security Mode Command sent from the AMF to the UE. An attacker with access to
NAS traffic on the N1 interface could replicate the NAS SeQuence Number (NAS SQN)
and craft a replayed NAS Security Mode Complete message. Alternatively, the attacker
could intercept a NAS Security Mode Complete message and retransmit it to the AMF.
If the AMF lacks sufficient safeguards against such attacks, the network may not detect
the replayed packet. Consequently, the attacker could impersonate a UE, prompting the
system to adopt a weaker security algorithm or disable security altogether, in both cases
undermining the system integrity.
The results presented in [18] point out that the free5Gc AMF is protected against the
NAS-5G SMC replay attack. Our focus is to ascertain whether Open5GS and OAI have
incorporated adequate security measures to thwart this kind of replay attack.
The rules necessary for executing a replay attack on the N1 interface need to be
configured within a configuration file (named nas-smc-replay-attack.xml) in the directory
5greplay/rules.The rule comprises two events with a minimal delay of 0 ms and a maximum
delay of 10 ms. The first event identifies a NAS Security Mode Command message using
the NAS message type, set to 93. The second event detects the expected receipt of a NAS
Security Mode Complete message after the first event, identified by the NAS security type,
which is 4. This rule serves to filter captured network packets, transmitting only those
aligned with the specified conditions.
SQL injection revolves around infusing malevolent SQL commands into an API end-
point responsible for interacting with databases, aiming to gain unauthorized access to
sensitive data or manipulate existing information.
Command injection transpires when malicious commands are injected into an API
endpoint capable of executing system commands, facilitating the execution of arbitrary
code on the server.
Payload injection ensues when harmful payloads are injected into an API endpoint
that processes untrusted data, ultimately leading to the execution of arbitrary code on
the server.
The implications of API injection are grave, encompassing data breaches, illicit access
to confidential information, and service disruptions. Mitigating this threat necessitates
the implementation of robust input validation, fortified authentication, and access con-
trol mechanisms.
Given the 5GC’s reliance on REST API requests (HTTP/2), the NFs of the SBA be-
come susceptible to the entire gamut of web application attacks, thereby expanding its
attack surface. Consequently, the adoption of automated tools like network vulnerability
assessment tools becomes indispensable. In our tests, we employed the Burp Suite tool,
but for Open5GS experiments an additional ad hoc “translator”, named 5GHTTPModi-
fier, was also necessary, due to the lack of support (by Burp Suite and similar tools) for
active scans on HTTP/2 servers that do not support TLS, such as Open5GS. In more detail,
5GHTTPModifier takes an XML file containing requests for a specific API as input, and then
transforms them into legitimate requests for Open5GS. The tool ensures proper request
forwarding and logs response data. In the case of AOI, the direct utilization of Burp Suite
was possible using HTTP1.1. For this HTTP version, Burp Suite does not require TLS usage.
Burp Suite is equipped to assimilate an API schema (defined in OpenAPI) as input and
initiate an active scan on the specified target, subsequently generating a comprehensive
report detailing the identified vulnerabilities.
Burp Suite encompasses an extensive array of vulnerability tests, with a comprehen-
sive list available at portswigger.net/kb/issues. Notable tests include OS command injection,
SQL injection, File path traversal, PHP code injection, Server-side JavaScript code injection,
and HTTP request smuggling. Moreover, the tool undertakes injection attempts across
various elements of a request (such as parameters, body, headers, cookies, etc.), or at
predefined points.
The testing methodology we adopted for API injection entails the following steps:
1. Parse the API schema definition (OpenAPI 3.0.0) using Burp Suite.
2. Initiate an automated scan for each API service in the OAI testbed, injecting malicious
parameters/payloads at various junctures of the HTTP requests, including headers,
body, and URLs.
3. Analyze the scan results for the OAI testbed and export them as an XML file, which
serves as the input for the 5GHTTPModifier tool.
4. Execute the 5GHTTPModifier tool for each output obtained from the previous scan
in the Open5GS testbed.
In both testbeds, throughout the attack, the AMF continued to send its reports to the
NRF and managed incoming connections. The only difference is that in the Open5GS case,
the AMF logs displayed a nghttp2_session_mem_recv() failed message, indicating that the
incoming requests did not adhere to the HTTP/2 protocol. Such an error message was
expected since the tool only supports HTTP/1.1, while Open5GS (unlike OAI) only allows
core network deployment through HTTP/2.
Although the attacks were unsuccessful (see the limitations of our implementation
discussed in Section 5.2), they pointed out the need to implement a limiting mechanism to
counteract TCP ACK flooding attacks.
In both the OAI and Open5GS testbeds, the attacks on the NRF did not lead to any
noticeable slowdowns or unfulfilled requests. Throughout the attacks, we were able to
ping the machine consistently, and the heartbeats among various NFs remained unaffected.
core (and the core identifies this through the SUCI - known UE by SUCI), it sends a context
release request to the legitimate gNB to which the UE was previously connected, resulting
in the UE losing connectivity to the core.
Replay of the registration request begins, but this time, core 5G realizes that the
message has been compromised through MAC verification (NAS MAC verification) and
sends an “Authentication Rejected” message. Subsequent messages from the UE to the
AMF (UplinkNASTransport) are all verified through the MAC, which can detect a replay
attack and trigger a context release request from the UE. This action results in the removal of
the UE from the core. The UPF and SMF then proceed to eliminate the context information
associated with the gNB that registered through the replay attack (which was fake). The
fake gNB is instructed to release the UE’s context, but since no actual gNB exists, the
connection request is denied. Following this, the AMF removes the UE information and
reports the count of UEs connected to the gNBs, which now amounts to 0. This indicates
that there are no longer any UE devices connected to the gNB (5G base station). The MFA
(Mobility Management Function for Access) removes the fake gNB from its list and reports
the total number of gNBs, which is now 1.
Analyzing the DN reachability request from a legitimate UE, a request for an Ini-
tialUEMessage is received from the genuine gNB. The MFA proceeds to add this device
to the list of known devices (now totaling 1) and associates it with a TMSI. However,
the request ultimately fails because there is no active session established for this UE at
that moment.
Finally, let us consider the UE restart. The registration process begins with the trans-
mission of the InitialUEMessage to initiate registration at the core. Consequently, the
count of UEs registered to the gNBs rises to 2, even though it is actually the same UE
(the core is not aware of this yet). When the AMF recognizes an already known SUCI, it
requests the gNB to release the context. During this registration request, the AMF detects
an already-allocated 5G-GUTI, leading to the release of the context, resulting in the UE
count associated with the gNB reverting to 1. At this juncture, an authentication request
is dispatched to the AMF, initiating the SMC procedure. Regrettably, the SMC procedure
fails to terminate correctly, resulting in the rejection of the registration. The UE context
is released, and the SUCI-related data are erased. Subsequently, after a few seconds, the
UE retries the registration procedure, which concludes successfully this time. Normal
operation of the UE is restored.
and instances of NFs. The imported schema for the nnrf-nfm interface is depicted in
Figure 4: the various available services and methods include creating, updating, deleting,
and retrieving NF subscriptions and instances.
Recall that Open5GS and OAI employ different communication protocols for their
Core Network deployment; however, it is important to note that both frameworks do not
support TLS. While OAI supports HTTP/1.1 and HTTP/2 SBA communications, Open5GS
only supports HTTP/2. As already pointed out, this disparity in protocol support leads to
distinct testing approaches for the two frameworks:
• OAI Testing Approach: we utilized Burp Suite, which can receive input (via the 5GC
API Parse plugin) in the form of a definition file containing the OpenAPI 3.0 schema
of the API interfaces, and it delivers requests in the format prescribed by the 3GPP
standard. The parameters of Burp Suite were configured to maximize the number of
tests performed with the imported API schema, including the activation of the “HTTP
smuggler” and “ActiveScan++” extensions to enhance the diversity of tests.
• Open5GS Testing Approach: Starting with the requests that were exported and ex-
ecuted on OAI, we employed the custom tool 5GHTTPModifier. This tool takes as
input the path containing all the tests exported from Burp Suite and modifies the
parameters, configuring them for the new 5G core. It then sends these requests after
transforming them into the HTTP/2 format. Using this tool, we were able to execute
identical tests as those performed on OAI, facilitating an objective comparison of the
security levels between the two frameworks.
errors were observed. In some cases, these errors provided overly informative details,
including information about the library and programming language used, which
could be valuable to potential attackers.
• OPTIONS-NF Instances (Store): This particular API was found to be unimple-
mented, as every request simply yielded the response “Do some magic”.
• GET-NF Instances (Store): Requests containing SQL commands within the param-
eters were not rejected but instead accepted and ignored. Ideally, any requests that
deviate from the specifications outlined in the schema should be rejected. For instance,
if a parameter is declared as an integer but passed as a string, the entire API request
should be rejected. Additionally, it was possible to input any value in optional param-
eters (such as the “limit” parameter in “nf-instances?nf-type&=”“limit=”), and the
API would still return a valid response.
To conclude the paper we would like to provide a high-level view of the security
issues, highlighting also architectural aspects of the implementations:
• Requests to the NRF can be sent by any machine that can reach it, i.e., there is no
authentication token check to verify identity, and thus authorization, to access the
network and services. Relying on perimeter security (firewalls and traffic closures)
to secure an NF is a weak approach; instead, we must assume a zero-trust design,
assuming that anyone can contact the NFs. A DELETE NF Instance by any NF within
the core would result in a DoS attack.
• Traffic not encrypted in SBI: in the core 5G, another high-impact issue is the inter-
ception of SBA traffic. In both Open5GS and OAI, traffic in the SBI is not encrypted,
exposing the core to replay attacks, API injections, and other attacks.
• No rate-limiting on requests to the AMF or NRF: in fact, all requests are answered.
This means that no security mechanism is in place to mitigate a DDoS attack, like a
SecGW might be.
• No control mechanism (filtering) on user-set values: reliance is placed on client-side
filtering when control should also be carried out server-side.
• Replay attacks on N1/N2 interface successfully executed: no security mechanism
(sequence number) inserted to counter this attack.
Finally, it is worth mentioning that the implementation of the considered frameworks
is still evolving and some features might be included only temporarily. However, the
analysis methodology presented in the paper can be applied with minor changes to any
new release and will permit tracking the evolution of open-source software for the 5G
core network.
Author Contributions: Conceptualization, F.D., R.G.G. and M.P.; investigation, F.D.; resources, F.D.;
writing—original draft preparation, R.G.G. and M.P.; writing—review and editing, R.G.G. and M.P.;
supervision, R.G.G. and M.P.; funding acquisition, R.G.G. and M.P. All authors have read and agreed
to the published version of the manuscript.
Funding: This work was partially supported by the Italian Ministry of Education and Research
(MIUR) in the framework of the FoReLab project (Departments of Excellence) and by the University
of Pisa in the framework of the PRA_2022_64 “hOlistic Sustainable Management of distributed
softWARE systems (OSMWARE)” project.
Data Availability Statement: The GitHub repository [6] contains traffic captures, scripts, and results
of the tests described in this paper.
Conflicts of Interest: The authors declare no conflicts of interest. The funders had no role in the design
of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or
in the decision to publish the results.
Acronyms
The following acronyms (listed in alphabetic order) are used in this manuscript:
IPsec IP Security
MCC Mobile Country Code
MEC Multiaccess Edge Computing
MNC Mobile Network Code
MNO Mobile Network Operator
MSIN Mobile Subscriber Identification Number
N3IWF Non-3GPP Interworking Function
NAS Non-Access Stratum
NEF Network Exposure Function
NF Network Function
NRF Network Repository Function
NSI Network Specific Identifier
OAI Open-Air Interface
RAN Radio Access Network
SBA Service-Based Architecture
SBI Service-Based Interface
SecGW Security Gateway
SEPP Security Edge Proxy Protection
SIM Subscriber Identity Module
SMC Security Mode Command
SMF Session Management Function
SUCI Subscription Concealed Identifier
SUPI Subscriber Permanent Identifier
TLS Transport Layer Security
UE User Equipment
UPF User Plane Function
UP User Plane
WAF Web Application Firewall
References
1. Witkowski, D. Bridging the Gap: 21st Century Wireless Telecommunications Handbook, 2nd ed.; Independent Publishing Platform:
Joint Venture Silicon Valley, CA, USA, 2019.
2. CISCO. CISCO Annual Internet Report. 2020. Available online: https://www.cisco.com/c/en/us/solutions/collateral/executi
ve-perspectives/annual-internet-report/white-paper-c11-741490.html (accessed on 16 April 2023).
3. Open5GS. Available online: https://open5gs.org/ (accessed on 30 September 2023).
4. Openairinterface: The Fastest Growing Community and Software Assets in 5g Wireless. Available online: https://openairinterfa
ce.org/ (accessed on 30 September 2023).
5. Wadatkar, P.V.; Garroppo, R.G.; Nencioni, G. 5G-MEC Testbeds for V2X Applications. Future Internet 2023, 15, 175. [CrossRef]
6. Dolente, F. Security Analysis of 5G Core Network. Available online: https://github.com/Spartan-F117/VAPT_CoreNetwork5G
(accessed on 30 September 2023).
7. Nencioni, G.; Garroppo, R.G.; Olimid, R.F. 5G Multi-Access Edge Computing: A Survey on Security, Dependability, and
Performance. IEEE Access 2023, 11, 63496–63533. [CrossRef]
8. Bozorgchenani, A.; Zarakovitis, C.C.; Chien, S.F.; Lim, H.S.; Ni, Q.; Gouglidis, A.; Mallouli, W. Joint Security-vs-QoS Framework:
Optimizing the Selection of Intrusion Detection Mechanisms in 5G Networks. In Proceedings of the 17th International Conference
on Availability, Reliability and Security, Vienna, Austria, 23–26 August 2022. [CrossRef]
9. Salazar, Z.; Zaïdi, F.; Nguyen, H.N.; Mallouli, W.; Cavalli, A.; de Oca, E.M. A Network Traffic Mutation Based Ontology, and Its
Application to 5G Networks. IEEE Access 2023, 11, 43925–43944. [CrossRef]
10. Mahyoub, M.; AbdulGhaffar, A.; Alalade, E.; Ndubisi, E.; Matrawy, A. Security Analysis of Critical 5G Interfaces. TechRxiv 2023.
[CrossRef]
11. Park, S.; Kim, D.; Park, Y.; Cho, H.; Kim, D.; Kwon, S. 5G Security Threat Assessment in Real Networks. Sensors 2021, 21, 5524.
[CrossRef] [PubMed]
12. Park, S.; Kwon, S.; Park, Y.; Kim, D.; You, I. Session Management for Security Systems in 5G Standalone Network. IEEE Access
2022, 10, 73421–73436. [CrossRef]
13. Basin, D.; Dreier, J.; Hirschi, L.; Radomirovic, S.; Sasse, R.; Stettler, V. A Formal Analysis of 5G Authentication. In Proceedings of
the 2018 ACM SIGSAC Conference on Computer and Communications Security, Toronto, ON, Canada, 15–19 October 2018; CCS
’18; pp. 1383–1396.
Future Internet 2024, 16, 1 23 of 24
14. Hussain, S.R.; Echeverria, M.; Karim, I.; Chowdhury, O.; Bertino, E. 5GReasoner: A Property-Directed Security and Privacy
Analysis Framework for 5G Cellular Network Protocol. In Proceedings of the 2019 ACM SIGSAC Conference on Computer and
Communications Security, London, UK, 11–15 November 2019; CCS ’19; pp. 669–684.
15. Yang, T.; Wang, S.; Zhan, B.; Zhan, N.; Li, J.; Xiang, S.; Xiang, Z.; Mao, B. Formal Analysis of 5G Authentication and Key
Management for Applications (AKMA). J. Syst. Archit. 2022, 126, 102478. [CrossRef]
16. Akon, M.; Yang, T.; Dong, Y.; Hussain, S.R. Formal Analysis of Access Control Mechanism of 5G Core Network. In Proceedings
of the 2023 ACM SIGSAC Conference on Computer and Communications Security, Melbourne Australia, 10–14 July 2023; CCS
’23; pp. 666–680. [CrossRef]
17. Group, N.C.C. The Challenges of Fuzzing 5G Protocols. 5G Secur. Smart Environ. 2021. Available online: https://research.nccgr
oup.com/2021/10/11/the-challenges-of-fuzzing-5g-protocols/ (accessed on 5 October 2023).
18. Salazar, Z.; Nguyen, H.N.; Mallouli, W.; Cavalli, A.R.; Montes de Oca, E. 5Greplay: A 5G Network Traffic Fuzzer—Application to
Attack Injection. In Proceedings of the 16th International Conference on Availability, Reliability and Security, Vienna, Austria,
17–20 August 2021; ARES ’21. [CrossRef]
19. 5GReplay. Available online: https://5greplay.org/docs.html (accessed on 30 September 2023).
20. Dumitru-Guzu, O.M.; Vlădeanu, C. Analysis of Potential Threats in NextGen 5G Core. In Proceedings of the 2022 International
Symposium on Electronics and Telecommunications (ISETC), Timisoara, Romania, 10–11 November 2022; pp. 1–4. [CrossRef]
21. 3GPP. TS 23.501 V16.4.0; System Architecture for the 5G System (5GS); Stage 2 (Release 16); ETSI: Sophia Antipolis, France, 2020.
22. ETSI. TS 129 501 V16.4.0 Principles and Guidelines for Services Definition; Technical Report; ETSI TS 129 501 Version 16.4.0; European
Telecommunications Standards Institute (ETSI): Sophia Antipolis, France, 2020.
23. Swagger. OpenAPI Specification Version 3.0.3. Available online: https://swagger.io/specification/v3/ (accessed on 30
September 2023).
24. 3GPP. OpenAPIs for the Service-Based Architecture. Available online: https://www.3gpp.org/technologies/openapis-for-the-s
ervice-based-architecture (accessed on 30 September 2023).
25. OAuth 2.0. Available online: https://oauth.net/2/ (accessed on 30 September 2023).
26. Polese, M.; Bonati, L.; D’Oro, S.; Basagni, S.; Melodia, T. Understanding O-RAN: Architecture, Interfaces, Algorithms, Security,
and Research Challenges. IEEE Commun. Surv. Tutor. 2023, 25, 1376–1411. [CrossRef]
27. Nair, P. Securing 5G and Evolving Architectures; ADDISON WESLEY Publishing Company Incorporated: Boston, MA, USA, 2021.
28. ETSI. TS 133 501—V17.8.0—5G; Security Architecture and Procedures for 5G System; Technical Report; 3GPP TS 33.501 Version 17.8.0
Release 17; ETSI: Sophia Antipolis, France, 2022.
29. Akash Tripathi, A.J.W. 5G Network Security Threats and 3GPP Security Mechanisms. Available online: https://techblog.comsoc.
org/2022/01/01/5g-network-security-threats-and-3gpp-security-mechanisms/ (accessed on 23 January 2023).
30. Palamà, I.; Gringoli, F.; Bianchi, G.; Blefari-Melazzi, N. IMSI Catchers in the wild: A real world 4G/5G assessment. Comput. Netw.
2021, 194, 108137. [CrossRef]
31. Chlosta, M.; Rupprecht, D.; Pöpper, C.; Holz, T. 5G SUCI-Catchers: Still Catching Them All? In Proceedings of the 14th ACM
Conference on Security and Privacy in Wireless and Mobile Networks, Virtual Event, 28 June–2 July 2021; WiSec ’21; pp. 359–364.
[CrossRef]
32. Nie, S.; Zhang, Y.; Wan, T.; Duan, H.; Li, S. Measuring the Deployment of 5G Security Enhancement. In Proceedings of the 15th
ACM Conference on Security and Privacy in Wireless and Mobile Networks, San Antonio, TX, USA, 16–19 May 2022; WiSec ’22;
pp. 169–174. [CrossRef]
33. Lasierra, O.; Garcia-Aviles, G.; Municio, E.; Skarmeta, A.F.; Costa-Pérez, X. European 5G Security in the Wild: Reality versus
Expectations. In Proceedings of the 16th ACM Conference on Security and Privacy in Wireless and Mobile Networks, WiSec 2023,
Guildford, UK, 29 May–1 June 2023; Boureanu, I., Schneider, S., Reaves, B., Tippenhauer, N.O., Eds.; ACM: New York, NY, USA,
2023; pp. 13–18. [CrossRef]
34. 3GPP. 3GPP TS 23.003 V15.11.0, Numbering, Addressing and Identification (Release 15); ETSI: Sophia Antipolis, France, 2021.
35. Lemes, M.T.; Alberti, A.M.; Both, C.B.; De Oliveira Júnior, A.C.; Cardoso, K.V. A Tutorial on Trusted and Untrusted Non-3GPP
Accesses in 5G Systems—First Steps Toward a Unified Communications Infrastructure. IEEE Access 2022, 10, 116662–116685.
[CrossRef]
36. Meneghello, F.; Calore, M.; Zucchetto, D.; Polese, M.; Zanella, A. IoT: Internet of threats? A survey of practical security
vulnerabilities in real IoT devices. IEEE Internet Things J. 2019, 6, 8182–8201. [CrossRef]
37. Abbasi, A.; Wetzels, J.; Holz, T.; Etalle, S. Challenges in designing exploit mitigations for deeply embedded systems. In
Proceedings of the 2019 IEEE European Symposium on Security and Privacy (EuroS&P), Stockholm, Sweden, 17–19 June 2019;
pp. 31–46.
38. Molin, A.; Riviš, A.M.; Marinescu, R. Assessing the real impact of open-source components in software systems. IEEE Access
2023, 11, 111226–111237. [CrossRef]
39. Yun, I.; Min, C.; Si, X.; Jang, Y.; Kim, T.; Naik, M. {APISan}: Sanitizing {API} Usages through Semantic {Cross-Checking}. In
Proceedings of the 25th USENIX Security Symposium (USENIX Security 16), Austin, TX, USA, 10–12 August 2016; pp. 363–378.
40. Keman, H.; Madnick, S.; Pearlson, K. Is Third-Party Software Leaving You Vulnerable to Cyberattacks? Harv. Bus. Rev. 2021.
Available online: https://hbr.org/2021/05/is-third-party-software-leaving-you-vulnerable-to-cyberattacks (accessed on 14
December 2023).
Future Internet 2024, 16, 1 24 of 24
41. Stradowski, S.; Madeyski, L. Exploring the challenges in software testing of the 5G system at Nokia: A survey. Inf. Softw. Technol.
2023, 153, 107067. [CrossRef]
42. PortSwigger. Available online: https://portswigger.net/burp/documentation (accessed on 14 September 2023).
43. Køien, G.M. On Threats to the 5G Service Based Architecture. Wirel. Pers. Commun. 2021, 119, 97–116. [CrossRef]
44. Shen, M.; Ye, K.; Liu, X.; Zhu, L.; Kang, J.; Yu, S.; Li, Q.; Xu, K. Machine Learning-Powered Encrypted Network Traffic Analysis:
A Comprehensive Survey. IEEE Commun. Surv. Tutor. 2023, 25, 791–824. [CrossRef]
45. Bousalem, B.; Silva, V.F.; Langar, R.; Cherrier, S. DDoS Attacks Detection and Mitigation in 5G and Beyond Networks: A Deep
Learning-based Approach. In Proceedings of the GLOBECOM 2022—2022 IEEE Global Communications Conference, Rio de
Janeiro, Brazil, 4–8 December 2022; pp. 1259–1264. [CrossRef]
46. MatrixTM. MHDDoS—DDoS Attack Script with 56 Methods. Available online: https://github.com/MatrixTM/MHDDoS
(accessed on 30 September 2023).
47. Burp Suite. Available online: https://portswigger.net/burp (accessed on 30 September 2023).
48. 3GPP. 3GPP TS 33.512 V16.6.0; 5G Security Assurance Specification (SCAS); Access and Mobility Management Function (AMF) (Release
16); ETSI: Sophia Antipolis, France, 2021.
49. Hu, X.; Liu, C.; Liu, S.; You, W.; Li, Y.; Zhao, Y. A systematic analysis method for 5g non-access stratum signalling security. IEEE
Access 2019, 7, 125424–125441. [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.