NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Reference hijacking: patching, protecting and analyzing on unmodified and non-rooted android devices

Wei You, Bin Liang, Wenchang Shi, Shuyang Zhu, Peng Wang, Sikefu Xie, Xiangyu ZhangICSE 2016

TL;DR

This paper introduces "reference hijacking," a novel technique to apply security enhancements to Android devices without requiring root access or modifying the core system. By intercepting and redirecting system library calls during application startup, they demonstrate its effectiveness in patching vulnerabilities, controlling inter-component communication, and performing dynamic taint analysis, making advanced security practical for everyday users.

What Problem Does This Paper Address?

Android's widespread adoption has made its security a critical concern. While many security enhancements have been proposed, their practical deployment on off-the-shelf devices is hindered by Android's strict security model. Specifically, applying these enhancements often requires modifying protected system files, which necessitates rooting the device or recompiling the entire Android OS. Rooting is unacceptable for most users due to security risks, and recompiling is complex and error-prone. This leaves a significant gap between theoretical security improvements and their real-world applicability, especially for patching vulnerabilities, enforcing custom security policies, and performing deep security analysis on legacy or unsupported devices.

Methods

The core innovation is reference hijacking, a technique that intercepts and redirects an application's access to underlying system libraries. This is achieved through a specially designed "environment reset procedure" that is triggered when a target application launches.

Here's how it works:

  1. Custom Application Entry Point: The target application's entry point is modified (either by repackaging or by subclassing the Application class) to include a custom RHApplication class.
  2. Environment Reset: When the application starts, RHApplication executes a custom executable, RHZygote.
  3. New Execution Environment: RHZygote sets up a new execution environment by modifying environment variables like BOOTCLASSPATH and LD_LIBRARY_PATH. These variables are pointed to a secure, readable-but-not-writable location where the security-enhanced system libraries are stored.
  4. Hijacked References: Consequently, when the application attempts to load system libraries (e.g., framework.jar, native libraries), it loads the security-enhanced versions instead of the original ones. This effectively redirects the application's references to the modified libraries.

The security-enhanced libraries are packaged as assets within an "assistant application" to ensure they are securely stored and can be shared across multiple target applications without being tampered with.

The authors demonstrate this technique by building three prototypes:

  • PatchMan: Patches vulnerable system libraries for devices that no longer receive official updates.
  • ControlMan: Enforces fine-grained access control policies for inter-component communications (ICCs) beyond Android's default model.
  • TaintMan: Performs dynamic taint analysis (DTA) for malware detection and privacy leakage analysis, even on real devices without emulation.

Datasets

The paper does not explicitly mention specific datasets for training. However, it uses real-world Android devices and applications for evaluation.

  • Evaluated Devices: A diverse set of 10 prevalent Android devices covering versions from 2.x to 5.x, and both Dalvik and ART runtime environments.
  • Target Applications:
    • For PatchMan: LinkedIn was used as a target application to demonstrate patching vulnerabilities like FakeID and Heartbleed.
  • For ControlMan: An experimental application was developed to issue/serve ICC requests, and the "OI Safe" password manager was used to demonstrate blocking malicious ICC attacks.
  • For TaintMan: 150 malware samples from the Android Malware Genome Project and 100 popular real-world applications were used.

Key Insights and Ideas

  • Practicality is Key: The most significant insight is that advanced security features can be made practical for end-users by focusing on deployment mechanisms that bypass root requirements and system modifications.
  • Reference Hijacking as a Universal Enabler: The technique is presented as a general-purpose enabler for a wide range of security enhancements, not just a specific solution. Its ability to redirect library calls makes it applicable to patching, access control, and dynamic analysis.
  • Bridging the Gap for Legacy Devices: PatchMan specifically addresses the critical issue of outdated devices with unpatched vulnerabilities, a problem exacerbated by manufacturers' limited support windows.
  • Beyond Default Security: ControlMan highlights that Android's built-in security model, while robust, has limitations. Reference hijacking allows for more granular and user-defined security policies for inter-component communication.
  • Real-Device Analysis: TaintMan's ability to perform dynamic taint analysis on real, unmodified devices is crucial for detecting sophisticated malware that may evade emulators or sandbox environments.

Key Results

  • Broad Applicability: Reference hijacking was successfully demonstrated on 10 different Android devices spanning versions 2.x to 5.x, working with both Dalvik and ART runtimes.
  • Minimal Overhead: The technique introduces a small, acceptable launch time delay (less than 1.5 seconds) and performance overhead (around 10-20% for ControlMan, less than 20% for TaintMan), which is deemed acceptable given the security benefits.
  • Effectiveness of Prototypes:
    • PatchMan: Successfully patched vulnerabilities (FakeID, Heartbleed) and blocked corresponding attacks on target applications like LinkedIn without affecting normal functionality.
  • ControlMan: Effectively blocked malicious ICC requests, preventing data leakage from applications like "OI Safe."
    • TaintMan: Successfully detected privacy-breaching behaviors in malware samples and real-world applications, showing comparable or superior results to TaintDroid in some cases, especially for malware that evades emulators.
  • No Root/Flashing Required: All prototypes were deployed on off-the-shelf devices without requiring root privileges or flashing the device's system image.

Limitations and Future Work

  • Application Repackaging: The current implementation requires repackaging the target application to inject the RHApplication class. This might be challenging for applications that perform integrity checks on their packages.
  • Future Work:
    • Bypassing Integrity Checks: The authors suggest that future work could involve bypassing application integrity checks.
  • Integration with Sandboxing: Combining reference hijacking with sandboxing techniques like Boxify [30] is proposed as a way to create more robust security solutions.
  • On-the-Fly Protection: Extending TaintMan to provide on-the-fly protection against attacks like command injection.
  • Mitigating Security Risks: The authors acknowledge that reference hijacking, like any powerful technique, can be used maliciously. They plan to research how to mitigate these security risks.
  • Support for Newer Android Versions: While the technique is shown to work on Android 5.x, adapting it to newer versions like Android 6.0 and beyond will require ongoing effort as Android's internal mechanisms evolve.

Summary updated

BibTeX
@inproceedings{you2016reference,
  author = {Wei You and Bin Liang and Wenchang Shi and Shuyang Zhu and Peng Wang and Sikefu Xie and Xiangyu Zhang},
  title = {{Reference hijacking: patching, protecting and analyzing on unmodified and non-rooted android devices}},
  booktitle = {ICSE},
  year = {2016},
  doi = {10.1145/2884781.2884863},
}
Figure