Source-linked AI summary

Towards LLM-Enhanced Android Taint Analysis

Nicholas Miazzo, Marco Alecci, Jordan Samhi, Jacques Klein, Eleonora Losiouk

arXiv:2608.24269v1cs.SEcs.CR

TL;DR

Traditional Android taint analyzers struggle with complex framework behaviors, prompting a study of whether off-the-shelf LLMs can reason about taint flows. An agentic LLM approach iteratively explores app code and, on DroidBench, Gemini-3 Flash achieves an F1-score of 0.96 versus 0.55 for FlowDroid, while suggesting complementary use in difficult cases.

  • Problem

    Traditional Android static analyzers struggle to model reflection, dynamic code loading, inter-component communication, and incomplete code accurately.

  • Method

    An LLM agent iteratively explores decompiled Android app code through MCP-enabled reverse-engineering tools to reason about source-to-sink taint flows.

  • Results

    Gemini-3 Flash achieves an F1-score of 0.96 versus 0.55 for FlowDroid on DroidBench, with particular strength on challenging taint flows.

  • Takeaways & Limitations

    LLM reasoning appears promising as a complementary technique for difficult Android taint-analysis scenarios rather than as a replacement for traditional analyzers.

  • Takeaways & Limitations

    LLM hallucinations and non-deterministic behavior can produce spurious taint flows or inconsistent results across runs, limiting reproducibility and reliability.

Abstract

from arXiv · show

Taint analysis is a fundamental technique for detecting sensitive data leaks in Android apps. However, traditional static tools, such as FlowDroid, still face well-known challenges due to the complexity of accurately modeling the Android framework. In this paper, we investigate whether off-the-shelf Large Language Models (LLMs) can effectively reason about taint flows in Android apps. Our preliminary approach relies on an agentic interaction strategy, enabling the LLM to iteratively explore code and reason about data flows. We conduct an initial evaluation on the DroidBench benchmark against FlowDroid, where our approach outperforms the baseline: Gemini-3 Flash achieves an F1-score of 0.96, compared to 0.55 for FlowDroid. In particular, we observe improvements in challenging categories such as inter-component communication (0.95 vs. 0.17), implicit flows (0.94 vs. 0.00), and reflection (1.00 vs. 0.50), where FlowDroid typically struggles. On a small set of real-world apps, the LLM-based approach also identifies additional potential data leaks not reported by FlowDroid. These preliminary findings suggest that LLM reasoning may effectively complement traditional static taint analysis, motivating future research on hybrid LLM-enhanced taint analysis pipelines.

1 Introduction

This paper presents a preliminary LLM-driven approach to Android taint analysis in which an agent iteratively explores decompiled apps and reasons about potential data flows. The findings suggest LLM reasoning can complement traditional analyzers, especially for complex behaviors such as inter-component communication, reflection, and implicit flows.

  • Motivation: Taint analysis detects flows from privacy-critical sources to potentially unsafe sinks in Android applications.Examples include device identifiers, location data, and credentials flowing to network interfaces or logs.
  • Research question: The study asks whether off-the-shelf LLMs can effectively reason about Android taint flows without explicit framework models.The approach uses an MCP-based toolchain for iterative code exploration and flow reasoning.
  • Approach: The proposed analysis combines decompiled app code with MCP-enabled tool interaction, treating the LLM as an agent that dynamically navigates code.This design avoids constructing explicit models of the Android framework.
  • Findings: LLM-based reasoning often achieves higher recall for complex behaviors while showing comparable performance in more standard cases.The highlighted challenging scenarios include inter-component communication, reflection, and implicit flows.
  • Implications: The findings motivate a hybrid approach that applies traditional analyzers and LLM reasoning selectively rather than indiscriminately.LLMs appear particularly useful when traditional Android framework modeling becomes difficult.

2 Background

Android taint analysis tracks data from predefined sources to potentially dangerous sinks, but the platform’s execution model and framework complexity make accurate analysis difficult. FlowDroid addresses these challenges through static modeling of Android lifecycles and callbacks.

  • Taint Analysis for Android: Taint analysis tracks data flows from predefined sources to potentially dangerous sinks.
  • Taint Analysis for Android: Android taint analysis is complicated by event-driven execution, component lifecycles, inter-component communication, and extensive framework APIs.
  • Taint Analysis for Android: FlowDroid is a widely used static Android taint analysis tool that models Android lifecycles and callbacks to achieve high precision.

3 Experimental Setup

The approach uses an LLM agent with MCP-enabled reverse-engineering tools to explore Android applications and infer potential source-to-sink taint relationships. It combines decompilation, optional native-code analysis, repeated runs for consensus, and independent comparison with FlowDroid.

  • Approach Overview: The LLM dynamically navigates Android application code through MCP-enabled reverse-engineering tools instead of relying on manually engineered Android framework models.The approach uses JADX to recover application structure and infer potential source-to-sink relationships.
  • Analysis Workflow: JADX decompiles each APK, while Ghidra analyzes extracted .so binaries when native libraries are present.JADX and Ghidra are accessed through separate MCP servers that expose application and native-program structures to the LLM.
  • Consensus Procedure: ⌊N/2⌋+1 analyses are required for a detected flow to be considered valid, reducing the impact of hallucinations and spurious outputs.The same prompt is used across N runs, with N customizable according to the use case and available resources.
  • Implementation Details: Gemini 3 Flash and Qwen3.5-27B are orchestrated through Claude Code and Gemini CLI, covering proprietary and locally hosted open-source deployment scenarios.The deployment choice addresses convenience-oriented closed-source services as well as cost containment and confidentiality for self-hosted solutions.
  • Evaluation Procedure: 5 runs were used for open-source models and 3 for closed-source models in baseline evaluation, while real-world apps received 5 runs.The lower closed-source run count was due to API cost constraints.
  • Comparison with FlowDroid: The LLM-based approach and FlowDroid were executed independently without sharing FlowDroid outputs, detected flows, or taint specifications.This comparison setup prevents FlowDroid-derived information from being provided to the LLM during analysis.

4 Experimental Results

The preliminary evaluation compares the LLM-based approach with FlowDroid on DroidBench and in a small real-world app study. Gemini-3 Flash achieves a substantially higher overall DroidBench F1-score, while category analysis highlights gains in challenging cases and real-world analysis examines 17 additional reported flows.

  • RQ1: DroidBench comparison: DroidBench version 3.0 contains 190 test cases across 19 categories, and the evaluation measures precision, recall, and F1-score against ground truth.The benchmark covers challenges including lifecycle modeling, asynchronous callbacks, and UI interactions; Inter-App Communication is excluded because neither approach supports it.
  • RQ1: DroidBench comparison: 0.96 F1-score is achieved by Gemini-3 Flash, compared with 0.55 for FlowDroid.FlowDroid’s result combines precision 0.83 with recall 0.42, whereas the LLM-based approach outperforms it overall.
  • RQ2: Category-wise DroidBench analysis: LLM-based effectiveness varies across models, with some models outperforming FlowDroid across several DroidBench categories while others remain less effective.Substantial improvements are observed in InterComponentCommunication, ImplicitFlows, Reflection, and Native, where FlowDroid has limited or no recall.
  • RQ3: Real-world Android applications: The real-world study evaluates FlowDroid and the LLM-based approach on 5 randomly selected AndroZoo apps from Google Play within the last 5 years.The sample is deliberately small to enable thorough manual inspection because the study lacks ground truth for all real-world taint flows.
  • RQ3: Real-world Android applications: 17 additional flows reported by the LLM-based approach are manually inspected as previously undetected flows beyond those reported by FlowDroid.The analysis does not assume that all FlowDroid-reported flows are true positives, and two Android taint-analysis experts independently inspect the additional flows.

5 Discussion and Research Agenda

The discussion argues that LLMs can reason about Android taint flows without explicit framework modeling, particularly in challenging scenarios, while motivating selective hybrid analysis and broader evaluation. It also identifies explainability and real-world evaluation as important research needs.

  • LLMs without framework modeling: LLMs can identify non-trivial Android taint flows without explicit training or handcrafted Android framework knowledge.The passage presents this as a result suggesting LLM reasoning can operate without explicit framework modeling.
  • LLMs without framework modeling: LLMs appear particularly effective for challenging scenarios including ICC, implicit flows, reflection, and native code, where traditional analyzers often struggle.The passage contrasts these scenarios with the difficulties faced by traditional analyzers.
  • Hybrid and explainable analysis: Hybrid pipelines could let traditional analyzers handle common cases while selectively applying LLMs to more challenging taint-analysis scenarios.The proposed direction combines static analysis with LLM-based reasoning and triggers LLMs selectively.
  • Challenges in evaluation: Real-world taint-analysis evaluation remains challenging because labeled datasets are scarce and assessing real-world apps requires additional effort.The passage specifically contrasts this difficulty with benchmarks such as DroidBench, which provide ground truth.
  • Hybrid and explainable analysis: Future work will improve taint-flow explainability and evaluate broader app sets, additional LLMs, and more advanced prompting strategies.These goals are intended to better assess robustness and generalizability.

6 Limitations

The approach inherits LLM hallucinations and non-deterministic behavior, which can produce spurious taint flows and inconsistent results, limiting reproducibility and reliability in security-critical settings.

  • LLM-related limitations: LLM hallucinations and non-deterministic behavior may produce spurious taint flows or inconsistent results across runs.The study mitigates this partially by executing each prompt multiple times and retaining only majority-supported flows.

7 Related Work

Prior work applies LLMs to taint analysis in binaries, compiled code, embedded firmware, and traditional analysis pipelines, while other studies target Android malware and vulnerability detection. In contrast, this work uses LLMs to directly reason about end-to-end taint flows in Android apps.

  • LLM-Based Taint Analysis: LLM-based taint-analysis research includes static binary taint analysis, vulnerability detection in compiled code, taint-specification improvement, vulnerability reasoning, and embedded-firmware analysis.LATTE addresses compiled code, while other studies enhance traditional pipelines or apply taint reasoning to embedded firmware.
  • Limitations of Prior Work: These prior taint-analysis approaches do not target Android apps and/or mainly use LLMs to support existing analysis workflows.The passage contrasts their scope and role for LLMs with the approach presented here.
  • Android Security Applications: Recent Android-security studies leverage LLMs for malware and vulnerability detection rather than directly reasoning about end-to-end taint flows.The paper positions its approach as distinct from these Android-security applications.

8 Conclusion

The paper presents a preliminary empirical study of LLM reasoning for Android taint analysis. Compared with FlowDroid on DroidBench, Gemini-3 Flash achieves a higher F1-score, while LLMs appear promising as a complement to traditional static analyzers.

  • The paper conducts a preliminary empirical study of LLM reasoning for Android taint analysis.
  • 0.96 F1-score is achieved by Gemini-3 Flash on DroidBench, versus 0.55 for FlowDroid.
  • LLM-based reasoning helps identify challenging taint flows involving inter-component communication, reflection, and implicit flows.
  • LLMs appear promising as a complement to, rather than a replacement for, traditional static analyzers.
Loading 2608.24269v1…