DefDroid: Securing Android with Fine-Grained Security Policy

Chao Huang, Shuohong Wang, Haiyang Sun, Zhengwei QiSEKE 2015

Introduction

The traditional Android security model relies on an "all-or-nothing" permission system. When a user installs an application, they must grant all requested permissions or forgo the installation entirely. Once granted, these permissions provide broad access; for instance, a "Read Contacts" permission allows an app to access the entire contact database, regardless of whether it only needs a subset of that data. This lack of granularity creates significant risks for data leakage and privacy violations.

DefDroid addresses this gap by introducing a fine-grained access control mechanism that operates without requiring root privileges or modifications to the Android operating system. Instead, it employs bytecode instrumentation to inject security policies directly into the application's executable code.

System Architecture & Methodology

DefDroid's workflow revolves around repackaging existing Android applications (APKs) to include security enforcement logic. The process involves four primary stages:

  1. Deconstruction: The target APK is decompressed to extract the Dalvik executable (classes.dex).
  2. Translation: The Dalvik bytecode is converted into Java bytecode using dex2jar.
  3. Instrumentation: Using the DiSL domain-specific language, DefDroid identifies critical API calls—such as those interacting with the ContentResolver—and inserts security checks.
  4. Reconstruction: The modified bytecode is converted back to .dex, repackaged, and resigned.
DefDroid System Architecture

The architecture supports both global policies (for organizational-wide rules) and private policies (for specific apps). Furthermore, it enables dynamic policy updates via a central Policy Service, allowing administrators to modify security rules without re-instrumenting the application.

Evaluation & Results

The system was evaluated using 74 applications from the Google Play Store, categorized by the resources they access: Content Providers (37 apps), File Systems (22 apps), and Network (15 apps). Testing was conducted on a Google Nexus 7 tablet.

DefDroid achieved a high success rate, successfully repackaging 94.6% of the tested applications. Failures were primarily due to limitations in the underlying dex2jar tool rather than the DefDroid logic itself.

Performance Evaluation across Content Provider (a), File System (b), and Network (c) policies

Performance overhead varied by the type of policy enforced:

  • Contacts: Filtering by group increased execution time by approximately 60.9% due to additional database lookups.
  • File System: Overhead ranged from negligible for simple restrictions to 98.7% for complex checks.
  • Network: URL blacklisting introduced an average overhead of 47.2%.

While these percentages appear high, the absolute execution time remains within milliseconds, which the authors argue is acceptable for most user interactions.

Discussion & Limitations

DefDroid offers a "root-free" advantage, making it suitable for Enterprise Mobility Management (EMM) where device modification is often prohibited. By providing context-aware security—such as filtering specific contact groups or file types—it offers a level of control previously unavailable to standard users.

However, several limitations remain. Because DefDroid operates at the bytecode level, it cannot intercept calls made via the Java Native Interface (JNI) to C/C++ code. Additionally, the reliance on a specific toolchain makes it vulnerable to modern obfuscation techniques. Finally, repackaging requires resigning the app, which can disrupt official updates and shared user ID features.

Conclusion

DefDroid demonstrates a viable path toward fine-grained Android security that balances control with ease of deployment. By moving enforcement into the application layer, it provides a practical solution for securing sensitive data in environments where OS-level modifications are not feasible.

Summary updated

BibTeX
@inproceedings{huang2015defdroid,
  author = {Chao Huang and Shuohong Wang and Haiyang Sun and Zhengwei Qi},
  title = {{DefDroid: Securing Android with Fine-Grained Security Policy}},
  booktitle = {SEKE},
  year = {2015},
  doi = {10.18293/seke2015-162},
}
Figure