## 4 Security in 5G Infrastructure
### Vulnerabilities in 5G System
#### 4.2.1 Insecure API  
The vulnerabilities of each NF deployment mode include infrastructure (hardware and container) and communication (API) vulnerabilities:  
* Container vulnerabilities: Image vulnerabilities, insufficient isolation, improper configuration, container run-time vulnerabilities;
* Hardware and host vulnerabilities: hardware and software vulnerabilities or improper access control;
* Internal interfaces: API vulnerabilities (within SBI), insecure networking (eavesdropping);
* External interfaces: API vulnerabilities.  
API security is a crucial security aspect for 5 GC cloud-native functions. APIs often have simple code that assumes that clients handle filtering, lacking adequate security scrutiny for request and response messages. Developers may overlook the sensitivity of transferred information.  
Modern automated tools can exploit poorly implemented API interfaces for API injection attacks, causing information compromise, malfunction, or DoS attacks. An example of an automated tool is Burp Suite [42], used in the presented experimental evaluation to test the security level of the NF's API interfaces.  
\begin{table}
\begin{tabular}{l l l l l l} \hline \hline
**User Equipment** & **Air Interface** & **RAN** & **MEC** & **5G Packet Core** & **N6 and Roaming** \\ \hline Malware & MitM & Rouge Nodes & DDoS Attacks & \begin{tabular}{l} Virtualization Orchestration \\ Vulnerabilities \\ \end{tabular} & \begin{tabular}{l} IoT Core \\ Integration \\ \end{tabular} \\ \hline Firmware Hacks & Jamming & \begin{tabular}{l} Rouge \\ Applications \\ \end{tabular} & API Vulnerabilities & Improper Access Control & \begin{tabular}{l} App Server \\ Vulnerabilities \\ \end{tabular} \\ \hline Tampering & & \begin{tabular}{l} Insecure S1, X2 \\ \end{tabular} & \begin{tabular}{l} Side Channel \\ Attacks \\ \end{tabular} & \begin{tabular}{l} Network Slice \\ Vulnerabilities \\ \end{tabular} & \begin{tabular}{l} Application \\ Vulnerabilities \\ \end{tabular} \\ \hline Sensor & \begin{tabular}{l} Insecure Xx, Xn \\ \end{tabular} & \begin{tabular}{l} NFVi \\ Vulnerabilities \\ \end{tabular} & API Vulnerabilities & API Vulnerabilities \\ \hline  & & & & \
\begin{tabular}{l} NEF Vulnerabilities \\ \end{tabular} \\ \hline  & & & &
\begin{tabular}{l} Roaming Partner \\ \end{tabular} \\ \hline  & & & & DDoS and DoS Attacks \\ \hline \hline \end{tabular}
\end{table}
Table 1: Summary of vulnerabilities in 5G system.  
Note that the wide use of distributed computing architectures like Multiaccess Edge Computing (MEC) to improve the end-user experience or application performance introduces 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 3 GPP, 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 adherence to established API security protocols to counter API attacks.