Jekyll on iOS: When Benign Apps Become Evil

Tielei Wang, Kangjie Lu, Long Lu, Simon P. Chung, Wenke Lee

TL;DR

This paper introduces "Jekyll apps," a novel attack method that allows malicious iOS applications to bypass Apple's stringent App Store review and code-signing mechanisms. By hiding malicious logic within seemingly benign apps and exploiting vulnerabilities to dynamically assemble this logic at runtime, these apps can perform a wide range of harmful actions without user knowledge or detection.

What Problem Does This Paper Address?

Apple's iOS ecosystem relies heavily on a two-pronged security approach: a rigorous App Store review process and mandatory code signing. The App Store review aims to catch malicious apps before they reach users, while code signing ensures that only Apple-approved and unmodified code can run on devices. This system has historically made it difficult for malware to infiltrate iOS. However, the authors identify a critical gap: the review process primarily examines static code, and the code-signing mechanism verifies integrity at installation. This leaves a window of opportunity for apps that appear benign during review but can be instructed to execute malicious code after installation. The paper addresses how to exploit this gap to create apps that are both approved by Apple and capable of performing harmful actions.

Methods

The core of the "Jekyll app" attack lies in a two-phase strategy:

  1. Obfuscation and Deception during Review:
    • Remote Exploitability: Attackers embed subtle, remotely triggerable vulnerabilities (backdoors) within a seemingly normal app.
  2. Code Gadget Hiding: Malicious functionalities are decomposed into small "code gadgets" and hidden throughout the app's code space, often within infeasible branches or as "dead code."
    • Dynamic Logic Assembly: The app does not contain the full malicious logic statically. Instead, it's designed to be assembled at runtime.
  3. Runtime Exploitation and Malicious Execution:
    • Information Leakage: The app can be designed to leak its memory layout information, effectively bypassing Address Space Layout Randomization (ASLR).
  4. Control Flow Hijacking: Exploiting planted vulnerabilities (e.g., buffer overflows), attackers can hijack the app's control flow.
  5. Dynamic API Invocation: Using functions like dlopen and dlsym, the app can dynamically load private frameworks and invoke private APIs that are normally inaccessible to third-party apps.
  6. Gadget Chaining: The leaked memory layout and control flow hijacking allow attackers to chain the hidden code gadgets together to execute complex malicious operations.

This approach circumvents DEP and code signing because the malicious code is not present during review or installation, and the control flow is dynamically altered at runtime.

Datasets

Not discussed in the paper. The authors describe implementing a proof-of-concept app and testing it on a controlled group of their own devices.

Key Insights and Ideas

  • The "Jekyll" Analogy: The name "Jekyll app" perfectly captures the dual nature: a benign facade during review and a malicious entity at runtime.
  • Exploiting the Review Blind Spot: The fundamental insight is that static analysis during app review cannot fully capture dynamic runtime behavior, especially when that behavior is triggered by external commands and involves dynamically assembled code.
  • Private API Abuse: The paper highlights how private APIs, intended for Apple's internal use, can be stealthily accessed and abused by third-party apps through dynamic loading, enabling powerful malicious actions.
  • Runtime Security is Crucial: The work strongly advocates for the necessity of runtime security monitoring mechanisms on iOS, as pre-release review alone is insufficient against such sophisticated attacks.
  • Gadget Availability is Key: Unlike traditional ROP attacks where attackers must find existing gadgets, Jekyll app developers are the attackers, giving them complete control over gadget creation and placement, making the attack more practical.

Key Results

The authors successfully developed a proof-of-concept Jekyll app, which was approved by Apple and subsequently used to perform various malicious operations on a controlled group of devices running iOS 5.x and 6.x. These operations included:

  • Stealthily posting tweets, sending emails, and sending SMS messages without user interaction.
  • Abusing the camera to record videos.
  • Stealing device identity information (IMEI, IMSI, ICCID).
  • Manipulating Bluetooth.
  • Dialing arbitrary numbers, including forwarding calls.
  • Crashing Mobile Safari by exploiting a vulnerability.
  • Exploiting a kernel NULL pointer dereference vulnerability, causing devices to reboot.

The app passed Apple's review process, demonstrating the effectiveness of the attack.

Limitations and Future Work

  • Manual Gadget Construction: The current implementation requires manual construction of ROP exploits and gadgets. The authors suggest that automatic ROP shellcode generation, as demonstrated on x86 platforms, could be a future research direction for Jekyll apps.
  • Detection Challenges: While the paper argues that detecting hidden gadgets is challenging even with source code auditing, it acknowledges that skilled attackers might employ systematic non-control data attacks or function-level gadgets to bypass certain defenses like Control Flow Integrity (CFI).
  • Future Work: The authors advocate for official support for runtime security monitoring mechanisms on iOS to complement the existing review process. They also suggest that type-safe programming languages could mitigate low-level memory errors.

Summary updated

BibTeX
@inproceedings{wang2013jekyll,
  author = {Tielei Wang and Kangjie Lu and Long Lu and Simon P. Chung and Wenke Lee},
  title = {{Jekyll on iOS: When Benign Apps Become Evil}},
  booktitle = {USENIX Security},
  year = {2013},
}

Loading related content...

Figure