When Program Analysis Meets Bytecode Search: Targeted and Efficient Inter-procedural Analysis of Modern Android Apps in BackDroid

Daoyuan Wu, Debin Gao, Robert H. Deng, Rocky K. C. Chang

TL;DR

BackDroid introduces a "targeted" paradigm for Android static analysis that replaces heavy, whole-app call graphs with agile, on-the-fly bytecode search. By focusing exclusively on security-sensitive "sinks" and tracing backward just-in-time, it achieves a 37x speedup over state-of-the-art tools and eliminates the timeouts that plague analysis of modern, large-scale apps.

What Problem Does This Paper Address?

Traditional Android static analysis tools (like FlowDroid and Amandroid) perform whole-app analysis. They attempt to build a comprehensive map of every possible execution path before checking for vulnerabilities.

However, Android apps have grown 3–4x in size over the last five years. This "upscaling" has made whole-app analysis computationally expensive and often impossible; existing tools frequently crash or time out (sometimes after 24+ hours) on a single large app. Furthermore, these tools often ignore third-party libraries to save time, potentially missing vulnerabilities. The authors argue that since security researchers usually only care about specific "sinks" (e.g., where data is encrypted or sent over the network), analyzing the entire codebase is an inefficient use of resources.

Methods

The core innovation is on-the-fly bytecode search. Instead of pre-calculating a massive call graph, BackDroid treats the disassembled bytecode as a searchable text space.

  1. Targeted Backtracking: It starts at a security-sensitive sink (like a crypto API) and searches the bytecode text to find its callers. It repeats this step-by-step until it reaches an entry point (like onCreate).
  2. Handling Java Complexity:
    • Basic Search: Directly locates callers for static, private, or constructor methods.
  3. Advanced Search: To handle polymorphism, interfaces, and callbacks (where a direct signature search fails), BackDroid searches for the object's constructor and performs forward object taint analysis to see where that object is eventually used to call the target method.
  4. Self-contained Slicing Graph (SSG): As it searches, it builds a lightweight, "self-contained" graph that only includes the code slices relevant to the specific sink being analyzed.
  5. Dataflow Analysis: Once the SSG is built, BackDroid performs traditional forward constant and points-to propagation over this tiny graph to determine if the parameters passed to the sink are actually insecure (e.g., using a hardcoded "ECB" mode in AES).

Datasets

The authors evaluated BackDroid using:

  • A longitudinal dataset: 22,687 popular Google Play apps collected between 2014 and 2018 to measure the trend of increasing app sizes.
  • The Evaluation Set: 3,178 modern apps with over 1 million installs each.
  • The Comparison Set: 144 apps specifically containing target sink APIs (for Crypto and SSL) were used for a head-to-head performance and accuracy battle against Amandroid.

Key Insights and Ideas

  • Search vs. Graphing: The "aha moment" is realizing that searching a text-based representation of bytecode is significantly faster than resolving every possible pointer and link in a massive memory-resident graph.
  • Constructor-Based Resolution: One of the cleverest tricks is how they handle interfaces. Instead of trying to guess which class implements an interface at a call site, they find where the object was born (the constructor) and follow it forward. This bypasses the need for a global points-to analysis.
  • Decoupling Size from Complexity: In BackDroid, the analysis time is proportional to the number of security sinks, not the total size of the app. This makes it "future-proof" against the continued growth of Android applications.

Key Results

  • Massive Speedup: BackDroid's median analysis time was 2.13 minutes, compared to 78.15 minutes for Amandroid—a 37x improvement.
  • Zero Timeouts: While Amandroid timed out on 35% of the apps (even with a 5-hour limit), BackDroid finished every app, with 77% completed in under 10 minutes.
  • Higher Efficacy: BackDroid discovered 54 additional vulnerable apps that Amandroid missed. These misses were largely due to Amandroid timing out or its default setting of skipping third-party libraries—libraries that BackDroid analyzes effortlessly because it only looks at the relevant parts.
  • Resource Efficiency: BackDroid ran successfully with only 4GB of RAM allocated to the JVM, whereas whole-app tools often require hundreds of gigabytes for large apps.

Limitations and Future Work

  • Reflection and Native Code: Like most static analysis tools, BackDroid struggles with Java reflection and JNI (native C/C++ code). The authors suggest integrating tools like DroidRA to help resolve reflection.
  • Source-to-Sink Analysis: Currently, BackDroid is optimized for "sink-based" problems (checking if an API is used correctly). The authors plan to extend it to "source-to-sink" problems, such as privacy leaks, by performing a two-way search (backward from sinks and forward from sources).
  • Dynamic Loading: Apps that download and execute code at runtime remain a challenge that may require hybrid analysis (combining static search with dynamic execution).

Summary updated

BibTeX
@inproceedings{wu2021when,
  author = {Daoyuan Wu and Debin Gao and Robert H. Deng and Rocky K. C. Chang},
  title = {{When Program Analysis Meets Bytecode Search: Targeted and Efficient Inter-procedural Analysis of Modern Android Apps in BackDroid}},
  booktitle = {Dsn},
  year = {2021},
  doi = {10.1109/dsn48987.2021.00063},
}
Figure