Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 48

Targeting 5G's SBA: API and Web Security Attacks

Recommended resources

Hello! Welcome to your next lesson.

In our previous lesson, we focused on the initial moments of a 5G connection, exploring vulnerabilities in the Radio Resource Control (RRC) protocol that exist before any security is activated. We saw how an attacker with a rogue base station could exploit this insecure window to downgrade service, cause denial-of-service, or even bypass authentication entirely.

Today, we shift our focus from the radio interface to the very heart of the 5G system: the core network. This lesson is designed to bridge the gap between your expertise in web security and the world of telecommunications. You'll see how the architectural choices made for 5G have brought familiar API and web security challenges into the core of the mobile network.

Our learning outcome is to describe how 5G's Service-Based Architecture (SBA) can be targeted using traditional API and web security attack patterns.

From Point-to-Point to a Web of Services

Previous cellular generations, like 4G, used an architecture with dedicated, point-to-point interfaces between network components. These interfaces relied on specialized telecommunication protocols (like Diameter). In contrast, the 5G Standalone (SA) core introduces a radical paradigm shift: the Service-Based Architecture (SBA).

The best way to think of the SBA is as a cloud-native, microservices-style ecosystem. Instead of rigid connections, it features a collection of Network Functions (NFs) that offer their capabilities to other NFs through standardized Application Programming Interfaces (APIs).

To understand what this shift means for security, please read the following article.

5G Standalone Security – Exploitation Risks in Service-Based Architecture and Roaming

The article '5G Standalone Security' from Bridge Connect provides a clear, high-level overview of the move to SBA and why this fundamentally changes the security landscape.

Read the 'Introduction' and 'Service-Based Architecture – Opportunity and Risk' sections. Pay close attention to the concepts of a 'web-like ecosystem', 'standardised APIs', and the use of 'HTTP/2 or RESTful interfaces'.

As the article highlights, this architecture relies on common web technologies. Communication between NFs like the AMF (Access and Mobility Management Function) and SMF (Session Management Function) now uses RESTful APIs, with data often formatted in JSON and transported over HTTP/2.

This image provides a detailed view of the 5G SBA and, crucially, the protocol stacks involved.

5G Service-Based Architecture (SBA) Control Plane and Protocol Stacks
This diagram illustrates the 5G SBA, showing how control plane Network Functions (AMF, SMF, etc.) communicate. Notice the protocol stack for these 'N' interfaces, which is built on HTTP/2, TLS, and TCP/IP—a stack you are very familiar with from web security.

The key takeaway is that the control plane of the 5G core network now operates using the same fundamental technologies as the modern web. This brings flexibility and speed but also exposes the core network to a class of vulnerabilities that were previously confined to web applications.


The New Attack Surface: Web Threats in the Core

Because SBA uses standard web protocols, the attack surface is no longer obscure. It's now accessible to a wide pool of security researchers and attackers who already possess web and API hacking skills. This opens a "new front door" into the mobile network.

Let's begin by looking at how this new API-driven model exposes the network to external entities and creates opportunities for attackers.

Attacks From a New Front Door in 4G & 5G Mobile Networks

This presentation from Black Hat, titled 'Attacks From a New Front Door in 4G & 5G Mobile Networks', introduces the concept of 'network exposure'—how operators are opening up network functions via APIs to third parties.

Watch from 02:38 to 06:31. The speaker explains how mobile networks are transitioning from closed, proprietary systems to ones that expose functionalities through APIs to external industries, using a drone control system as an example. This illustrates one major facet of the new API-driven attack surface.

While the video focuses on APIs exposed to external partners, the same principles and risks apply to the communications between the Network Functions (NFs) inside the core network itself.

The following research paper explains this internal threat very clearly.

[PDF] An Security Assessment Framework for 5G Core Networks - IEICE

The paper 'TELEscope: An Security Assessment Framework for 5G Core Networks' directly states how the use of RESTful APIs introduces traditional web application threats into the 5G core.

Please read Section I ('INTRODUCTION') and the first two paragraphs of Section II-A ('5G Core Network Architecture and SBA'). Focus on the explicit mention of vulnerabilities like 'authentication bypass, JSON injection, and OAuth misconfigurations' now affecting NF-to-NF communications.


Mapping Web Attack Patterns to the 5G Core

Your background in web security makes you perfectly equipped to understand the threats to the 5G SBA. Let's map some classic web/API attack patterns to the 5G core context, using concrete examples from security research.

1. Broken Authentication and Authorization

This is perhaps the most critical vulnerability category in any API-driven system, and the 5G core is no exception. In a web context, this might mean accessing another user's account. In the 5G core, it could mean a rogue service gaining a foothold in the network or an attacker accessing sensitive subscriber data.

  • Web Attack: An attacker makes an API call to /api/users/123/profile without a valid token and the server responds. Or, an attacker with a regular user token successfully calls an admin-only endpoint like /api/admin/deleteUser.
  • 5G SBA Equivalent:
    • Rogue NF Registration: An attacker connects to the core network and successfully registers a malicious NF with the Network Repository Function (NRF) because the NRF's API doesn't require authentication. This rogue NF could then be used to intercept or manipulate traffic.
    • Subscriber Data Theft: An attacker queries the Unified Data Management (UDM) or Unified Data Repository (UDR) APIs for a subscriber's data (e.g., authentication keys) and receives it, because the API endpoint lacks proper authorization checks.

The TELEscope paper provides direct evidence of these vulnerabilities in a real-world open-source 5G core implementation.

[PDF] An Security Assessment Framework for 5G Core Networks - IEICE

Let's revisit the TELEscope paper to see exactly how broken authentication was exploited.

Read the first four paragraphs of Section IV-B ('Security Assessment with Attack Chain Scenarios'). Focus on the descriptions for scenarios D02 (unauthenticated service enumeration), S01 (rogue NF registration), and S03 (unauthorized subscriber data extraction). Notice how the attacks are simple, unauthenticated HTTP requests to specific API endpoints.

2. Denial of Service (DoS) & Lack of Rate Limiting

In web applications, failing to limit the rate of incoming requests can allow an attacker to overwhelm a server, making it unavailable to legitimate users. The same logic applies to NFs in the 5G core.

  • Web Attack: An attacker sends thousands of password reset requests per second, overloading the mail server and CPU.
  • 5G SBA Equivalent:
    • API Flooding: A compromised or malicious component floods an NF (like the AMF) with API requests, consuming its resources and preventing it from handling legitimate mobility or session management procedures.
    • Forced De-registration: An attacker sends an unauthenticated DELETE request to the NRF's API to de-register a critical, legitimate NF, effectively taking it offline and disrupting the entire network.

The research from the Black Hat video found that this is a common design oversight.

Attacks From a New Front Door in 4G & 5G Mobile Networks

The speaker in the 'Attacks From a New Front Door' video discusses several design risks they found in commercial IoT platforms that expose network APIs. A lack of rate limiting is a key finding.

Watch the segment from 26:54 to 27:32. The speaker explicitly mentions that they 'couldn't really find rate limiting issues' and that even when documented, it wasn't always implemented. This highlights how a basic web security control is often overlooked in this new context.

The TELEscope paper also lists "Forced NF De-registration" and "Malformed API Requests" as tested scenarios (S02 and S04 in Table II) that lead to DoS.

3. Injection and Information Exposure

This category covers attacks where an attacker sends malformed data to cause unintended behavior (injection) or where the system reveals too much information about its internal state (information exposure).

  • Web Attack: An attacker submits a comment with <script>alert('XSS')</script> (XSS injection). Or, a failed request returns a verbose error message revealing database schema details (information exposure).
  • 5G SBA Equivalent:
    • API Enumeration: An attacker sends an unauthenticated discovery request to the NRF and receives a complete map of every NF in the network, their IP addresses, and the services they offer. This is a severe information leak that perfectly sets up further attacks. (This was scenario D02 from the TELEscope paper you read).
    • Service Crash via Malformed JSON: An attacker sends a syntactically valid but semantically incorrect JSON payload to an NF's API endpoint, triggering an unhandled exception in the parser and causing the NF process to crash.
    • Data Overexposure: A legitimate API call returns far more data than necessary. For example, a request for a device's connection status also returns sensitive credentials like the SIM card's PIN and PUK codes.

This final example of data overexposure was found by the researchers in the Black Hat video.

Attacks From a New Front Door in 4G & 5G Mobile Networks

This clip demonstrates a classic case of an API returning far too much sensitive information in a response.

Watch from 31:40 to 33:10. The speaker describes how a simple API call to check an SMS status returned a webhook response containing the SIM card's PIN/PUK, location, and billing information—a critical data overexposure flaw.


Conclusion

Today's lesson brought us into the core of the 5G network and revealed a surprising truth: its security is deeply intertwined with the principles of modern web and API security. The shift to the Service-Based Architecture, while powerful, has effectively imported a well-known class of vulnerabilities into critical telecommunications infrastructure.

Key Takeaways:

  • SBA is Web-Based: The 5G Service-Based Architecture replaces proprietary telecom protocols with a microservices-style system where Network Functions communicate via RESTful APIs over HTTP/2.
  • A Familiar Attack Surface: This architectural change exposes the 5G core to traditional web security attack patterns that are well-understood by a broad audience of security professionals.
  • Mapping Web Attacks to 5G:
    • Broken Authentication can lead to rogue NF registration or theft of subscriber data from the UDM.
    • Lack of Rate Limiting can enable Denial of Service attacks against critical NFs like the AMF or NRF.
    • Information Exposure can leak the entire network topology from the NRF.
    • Injection of malformed data can crash NFs, while Data Overexposure in API responses can leak sensitive user credentials.
  • Your Skills Are Relevant: Your expertise in identifying and exploiting vulnerabilities in web applications and APIs is directly applicable to assessing the security of the 5G core network.

Preview of the Next Lesson:

One of the most touted features enabled by the SBA is network slicing, the ability to create multiple virtual, isolated end-to-end networks on top of a single physical infrastructure. In our next lesson, we will explain the concept of network slicing and potential cross-slice security risks. We'll investigate whether these "slices" are truly isolated and how an attacker might pivot from a low-security slice (like one for simple IoT devices) to a high-security one (like one for emergency services).