TL;DR
Ripple is the first static analysis tool designed to resolve reflective calls in Android apps even when critical data-flow information is missing—a common scenario known as an Incomplete Information Environment (IIE). By inferring types from how reflected objects are used (e.g., through type casts), Ripple discovered 45% more reflective targets than traditional methods, enabling security tools to detect hundreds of previously hidden data leaks.
What Problem Does This Paper Address?
Static analysis is a cornerstone of Android security, used to find malware and data leaks before an app is ever installed. However, reflection—a feature that allows a program to inspect and modify its own structure at runtime—is a major "blind spot."
Normally, an analyzer needs to see the string name of a class or method (e.g., "com.example.MyClass") to know what code is being executed. If that name is provided by an external source like an Intent, a library, or a database, the analyzer often sees a "null" or "unknown" value. The authors call these Incomplete Information Environments (IIEs). In these cases, traditional tools simply give up, leaving "holes" in the app's call graph where malicious behavior or sensitive data leaks can hide.
Methods
The authors introduce Ripple, a tool built on the Soot framework that handles reflection through a three-tiered approach:
- String Inference (Standard): Handles cases where class/method names are constant strings.
- Type Inference for Non-Constants: Handles cases where names are non-null but determined by complex logic (e.g., read from a config file).
- Type Inference for Information-Missing Calls (The Innovation): This is Ripple’s core contribution. When a class name is completely missing (null/statically unknown), Ripple looks at the post-dominating type cast.
- Example: If the code says
Object v = clz.newInstance(); MyActivity act = (MyActivity) v;, Ripple realizes that even if it doesn't know whatclzis, the resulting objectvmust be an instance ofMyActivityor its subclasses.
Ripple performs this analysis "mutually recursively" with pointer analysis, meaning it uses what it learns about reflection to improve its understanding of where variables point, and vice versa, until it has a complete picture of the app.
Datasets
The researchers evaluated Ripple using 17 popular Android apps downloaded from Google Play (including titles like Angry Birds, Facebook Messenger, and SimCity). These apps were selected because they represent a wide range of IIEs, such as undetermined Intents and unmodeled system services, and were large enough to test the tool's scalability.
Key Insights and Ideas
- The "Cast" is Key: The most powerful insight is that while the input to a reflective call (the name) might be missing, the output is often immediately constrained by a type cast so the programmer can actually use the object. Ripple turns this programming necessity into an analytical advantage.
- IIEs are Ubiquitous: Missing information isn't just a result of bad coding or obfuscation; it's inherent to the Android framework. Intents, callbacks, and system services frequently break the "chain" of data-flow that static analyzers rely on.
- Soundness vs. Precision: Traditional tools often sacrifice "soundness" (finding everything) for "precision" (avoiding false alarms). Ripple argues that in security, missing a malicious behavior is worse than a few false positives, and it proves that you can achieve high soundness with a manageable false positive rate.
Key Results
- Increased Coverage: Ripple discovered 72 more true reflective targets than standard string inference across the 17 test apps, a 45% increase in soundness.
- Security Impact: By resolving these reflective calls, Ripple allowed FlowDroid (a popular taint analysis tool) to find 310 additional sensitive data leakages that were previously invisible.
- Efficiency: Despite the complexity of the analysis, Ripple is fast. It resolved reflective targets for most apps in under 10 seconds, making it practical for real-world security pipelines.
- Precision: Ripple maintained a respectable false positive rate of 21.9%, which is considered effective for automated security vetting.
Limitations and Future Work
- False Positives: While 21.9% is good, it still requires manual effort to filter out "ghost" behaviors. The authors suggest that using more advanced, "object-sensitive" pointer analysis could reduce this.
- Reliance on Casts: Ripple’s most effective trick relies on the presence of type casts. If an app uses reflection and then interacts with the object purely through further reflection or generic interfaces without casting, Ripple may still miss the target.
- Future Directions: The authors plan to integrate Ripple with dynamic analysis (running the code) to create a hybrid system that captures even more elusive runtime behaviors.
Summary updated