MalFlows: Context-Aware Fusion of Heterogeneous Flow Semantics for Android Malware Detection

Zhaoyi Meng, Fenglei Xu, Wenxiang Zhao, Wansen Wang, Wenchao Huang, Jie Cui, Hong Zhong, Yan Xiong

MalFlows: Context-aware Fusion of Heterogeneous Flow Semantics for Android Malware Detection

TL;DR

MalFlows is a novel Android malware detection framework that integrates three distinct types of program flows—control, data, and inter-component communication (ICC)—into a single, context-aware Heterogeneous Information Network (HIN). By using a specialized embedding technique called flow2vec and a channel-attention fusion mechanism, it achieves a 98.34% detection accuracy and demonstrates superior resilience to "app evolution" compared to existing state-of-the-art tools.

What Problem Does This Paper Address?

Android malware detection typically relies on static analysis to examine program flows. These flows generally fall into three categories:

  1. Control Flows: The logic and execution order of statements.
  2. Data Flows: How sensitive information moves from a source (e.g., GPS) to a sink (e.g., the network).
  3. Inter-Component Communications (ICCs): How different parts of an app (Activities, Services) interact.

The authors identify two major gaps in current research. First, most tools look at these flows in isolation, missing the "synergistic" clues that appear when you combine them. Second, existing multi-view methods are often context-unaware. In a standard graph model, a source API and a sink API might be linked simply because they exist in the same app, even if no actual data path connects them. This "semantic confusion" leads to inaccurate representations and false positives.

Methods

The MalFlows architecture consists of four main stages:

  • Data Collection: Uses off-the-shelf tools (IccTA, FlowDroid, Soot) to extract raw flow features and conditional statements from over 31,000 apps.
  • HIN Construction: Models the relationships between apps, APIs, conditions, and components as a Heterogeneous Information Network.
  • flow2vec (The Core Innovation):
    • Graph Refinement: To solve the context-unawareness problem, MalFlows "clones" nodes to ensure that links only exist if they are contextually valid (e.g., a specific source and sink are actually on the same data-flow path).
  • Meta-path Group Sampling: Instead of using a single path to describe an app, it uses "meta-path groups" (combining content-oriented and action-oriented paths) to guide random walks, which are then processed via Skip-gram to create vector embeddings.
  • Channel-Attention Fusion: The embeddings from the three flow views (control, data, ICC) are fed into a Deep Neural Network (DNN). A channel-attention mechanism dynamically weights these views, allowing the model to "focus" on whichever flow type is most indicative of maliciousness for a specific app.

Datasets

The study utilizes a massive dataset sourced from AndroZoo, comprising:

  • 31,301 real-world apps (16,667 benign and 14,634 malware) spanning from 2017 to 2024.
  • 20 million flow instances extracted in total.
  • Ground truth labels were obtained via VirusTotal, using a threshold of more than two antivirus engines to flag an app as malware.

Key Insights and Ideas

  • Context is King: The "aha moment" here is the realization that standard HINs are too "loose." By refining the graph to enforce contextual constraints, the authors prevent the model from learning "impossible" paths, significantly cleaning up the feature space.
  • Flow Complementarity: The paper proves that different flows provide orthogonal views. For example, a data flow might show what is being stolen, while a control flow (trigger condition) shows when it happens (e.g., only when the screen is off). Combining these makes the "intent" of the code much clearer.
  • Resilience to Aging: One of the biggest problems in malware detection is "aging"—models trained on 2018 data often fail on 2024 apps. MalFlows shows the slowest performance decline over time, suggesting that high-level flow semantics are more stable invariants than simple API names or strings.

Key Results

  • Superior Accuracy: MalFlows achieved an Accuracy of 98.34% and an F1-score of 0.9881, outperforming representative baselines like Drebin (93.97%), HinDroid (95.33%), and even the LLM-based AppPoet (95.81%).
  • Efficiency: Despite the complexity of the HIN, the classifier is extremely fast, with an average inference time of 0.02 ms per sample.
  • Ablation Success: Removing the "Graph Refinement" step caused accuracy to drop from 98.34% to 84.30%, highlighting how critical context-awareness is to the system's success.

Limitations and Future Work

  • Static Analysis Bottlenecks: Like all static tools, MalFlows struggles with heavy code obfuscation, dynamic code loading, and reflection. If the underlying tools (FlowDroid/IccTA) can't see the flow, MalFlows can't model it.
  • Label Noise: While the authors validated their results by excluding newer samples, relying on VirusTotal is always subject to a degree of label lag or noise.
  • Future Directions: The authors plan to explore hybrid analysis (combining static and dynamic data) and intend to use Large Language Models (LLMs) to automatically discover more effective meta-paths for the HIN.

Summary updated

BibTeX
@article{meng2026malflows,
  author = {Zhaoyi Meng and Fenglei Xu and Wenxiang Zhao and Wansen Wang and Wenchao Huang and Jie Cui and Hong Zhong and Yan Xiong},
  title = {{MalFlows: Context-Aware Fusion of Heterogeneous Flow Semantics for Android Malware Detection}},
  journal = {IEEE Trans. Dependable Secur. Comput.},
  year = {2026},
  doi = {10.1109/tdsc.2026.3656972},
}
Figure