Kuboid
Open Luck·Kuboid.in
Black Hat2023
Open in YouTube ↗

Over the Air, Under the Radar: Attacking and Securing the Pixel Modem

Black Hat2,313 views39:55over 2 years ago

This talk demonstrates a multi-stage remote code execution (RCE) attack against the Samsung Shannon baseband modem used in Google Pixel devices. The researchers leverage an out-of-bounds (OOB) write vulnerability in the ASN.1 decoder to achieve an arbitrary write primitive, which is then chained with an MMU misconfiguration to execute shellcode. The attack is fully over-the-air (OTA) and requires zero user interaction, enabling the attacker to intercept SMS messages and perform account takeovers. The presentation highlights the effectiveness of host-based fuzzing and emulation in identifying critical vulnerabilities in complex, proprietary modem firmware.

How the Samsung Shannon Modem Became a Zero-Click RCE Vector

TLDR: Researchers recently demonstrated a multi-stage remote code execution attack against the Samsung Shannon baseband modem found in Google Pixel devices. By chaining an out-of-bounds write in the ASN.1 decoder with an MMU misconfiguration, they achieved full system compromise without any user interaction. This research underscores the critical need for rigorous fuzzing and memory safety in proprietary baseband firmware.

Baseband security is often treated as a black box by the broader research community, largely due to the proprietary nature of the firmware and the high barrier to entry for hardware-based testing. However, the recent Black Hat 2023 presentation on the Samsung Shannon modem proves that this "black box" is increasingly porous. When an attacker can achieve remote code execution (RCE) over-the-air (OTA) without a single click from the user, the traditional perimeter of mobile security effectively vanishes.

The Anatomy of the Attack

The research team focused on the Shannon baseband modem, a component responsible for handling cellular communications. The attack chain is a masterclass in exploiting complex, low-level firmware. The primary entry point is an out-of-bounds (OOB) write vulnerability within the modem's ASN.1 decoder.

ASN.1 is a standard for encoding data structures, and the modem uses it to parse incoming cellular signaling. Because the modem processes these messages before the user even sees a notification, the vulnerability is inherently zero-click. The researchers identified that during the call setup stage in a 2G network, the decoder fails to properly validate the length of incoming data, allowing an attacker to write arbitrary bytes into the heap.

Chaining Primitives for Execution

Achieving an OOB write is only the first step. To turn this into reliable RCE, the researchers needed to bypass memory protections. They discovered a critical MMU misconfiguration that left significant portions of the modem's memory space marked as both writable and executable (RWX).

In a hardened environment, this would be a non-starter. However, the lack of standard exploit mitigations like Data Execution Prevention (DEP) or Address Space Layout Randomization (ASLR) in this specific firmware context meant the researchers could simply place their shellcode in a known memory location and redirect execution flow.

The exploitation process follows a precise flow:

  1. Stage 0: The attacker sends a small piece of shellcode to a known heap address via the OOB write.
  2. Trigger: The attacker triggers the OOB write again to overwrite a function pointer, specifically targeting a "free" function.
  3. Stage 1: Once the "free" function is called, execution jumps to the Stage 0 shellcode.
  4. Payload: The Stage 0 shellcode then pulls down the full Stage 1 payload, which contains the logic for intercepting SMS messages and performing account takeovers.

The researchers utilized AFLplusplus and FirmWire to emulate the modem environment. By compiling the target components into a test harness that runs on x86, they could fuzz the modem logic at scale without needing to flash physical hardware for every iteration. This approach is essential for anyone looking to audit proprietary baseband code.

Real-World Implications for Pentesters

For those of us conducting mobile security assessments, this research changes the threat model. You can no longer assume the baseband is a trusted boundary. If you are testing a device that relies on a Shannon-based modem, your scope should include the signaling layer.

During an engagement, an attacker with a software-defined radio (SDR) and a tool like YateBTS or OpenBTS can force a device to downgrade to 2G. Once the device is locked to your malicious base station, you have a direct pipe to the modem's parser. The impact is total: you can intercept two-factor authentication (2FA) codes sent via SMS, effectively bypassing MFA for any service tied to the victim's phone number.

Defensive Hardening

Defenders must prioritize the reduction of the attack surface. The most effective mitigation currently available is to disable 2G support entirely on the device. While this may impact connectivity in remote areas, it eliminates the primary vector for these types of downgrade attacks.

From a development perspective, the industry must move toward memory-safe languages like Rust for baseband firmware. The researchers noted that the state of compiler-based mitigations in bare-metal firmware is still lagging behind user-space code. Implementing OWASP-recommended memory safety practices and enabling modern exploit mitigations like Control Flow Integrity (CFI) is no longer optional for modem vendors.

This research is a stark reminder that the most dangerous vulnerabilities are often the ones we cannot see. The modem is a complex, legacy-ridden piece of hardware that sits at the heart of our mobile devices. If you are looking for the next big bug bounty, stop looking at the application layer and start looking at the signaling protocols. The baseband is wide open, and it is only a matter of time before more researchers start poking at it.

Talk Type
research presentation
Difficulty
expert
Has Demo Has Code Tool Released


Black Hat USA 2023

118 talks · 2023
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in