HiGraph: A Large-Scale Hierarchical Graph Dataset for Malware Analysis

Han Chen, Hanchen Wang, Hongmei Chen, Ying Zhang, Lu Qin, Wenjie Zhang

Abstract

The advancement of graph-based malware analysis is critically limited by the absence of large-scale datasets that capture the inherent hierarchical structure of software. Existing methods often oversimplify programs into single-level graphs, failing to model the crucial semantic relationship between high-level functional interactions and low-level instruction logic. To bridge this gap, we introduce HiGraph, the largest public hierarchical graph dataset for malware analysis, comprising over 200M Control Flow Graphs (CFGs) nested within 595K Function Call Graphs (FCGs). This two-level representation preserves structural semantics essential for building robust detectors resilient to code obfuscation and malware evolution. We demonstrate HiGraph's utility through a large-scale analysis that reveals distinct structural properties of benign and malicious software, establishing it as a foundational benchmark for the community.

The Challenge of Malware Evolution

In the ongoing arms race between malware authors and security researchers, graph-based analysis has emerged as a powerful weapon. By representing programs as graphs, researchers can use Graph Neural Networks (GNNs) to detect malicious patterns that bypass traditional signature-based scanners. However, most existing tools treat programs as "flat" structures, oversimplifying the complex, nested reality of software.

In software, hierarchy matters. Programs consist of functions that call one another (the Function Call Graph or FCG), and each function contains its own internal logic (the Control Flow Graph or CFG). When malware evolves, it often changes its low-level implementation details while keeping its high-level behavioral "skeleton" intact.

Comparison of CryptoLocker V1 and V2 pseudo-code showing how implementation logic evolves while the high-level intent remains similar.

For example, as seen in the evolution of the CryptoLocker ransomware, an attacker might switch from simple XOR encryption to a complex AES+RSA hybrid. Flat graphs often miss this persistent behavioral "skeleton," making them easy to fool with simple code tweaks.

The HiGraph Dataset

HiGraph is a massive new dataset designed to preserve these hierarchical relationships. It features:

  • Scale: 595,211 Android applications (57,184 malicious, 538,027 benign).
  • Complexity: 595,211 global FCGs containing a staggering 201,792,085 local CFGs.
  • Curation: Sourced from AndroZoo (2012–2022) with ground-truth labels from VirusTotal.

This dataset dwarfs previous benchmarks like Malnet by providing a nested structure that is orders of magnitude more detailed, enabling the development of GNNs that are significantly more robust against code obfuscation and concept drift.

Methods: Capturing the Hierarchy

The researchers developed a pipeline to extract this two-level hierarchy from over half a million Android apps. They used static analysis to generate a global FCG for each app, where each node in that FCG is then linked to its own local CFG.

The hierarchical structure of HiGraph, showing local Control Flow Graphs (G) nested within a global Function Call Graph (G).

To prove the value of this data, they proposed Hi-GNN, a dual-encoder model. One GNN learns the "local" logic from the CFGs, while another learns the "global" architecture from the FCG. These two perspectives are then fused to make a final prediction. Crucially, they tested for "concept drift" by training on older data (2012) and testing on subsequent years (up to 2016) to evaluate temporal robustness.

Key Insights and Results

Analysis of the HiGraph dataset revealed several distinct structural properties of malicious software:

  • The "Hub" Signature: Malicious applications tend to have higher PageRank values in their FCGs, suggesting they rely on centralized "hubs"—specific functions that act as critical control points for malicious activity.
  • Divergent Evolution: While benign apps tend to become more modular and sparse over time, malware tends to become denser and more tightly interconnected, likely an intentional choice for obfuscation.
  • Superior Detection: The hierarchical Hi-GNN outperformed all standard "flat" GNN baselines (GCN, GAT, GIN, and GraphSAGE), achieving a Macro F1 score of 0.734.
  • Resilience to Time: Hi-GNN showed significantly less performance decay over a four-year period, maintaining an Area Under Time (AUT) of 0.715, while flat models struggled to adapt to evolving malware families.

Conclusion

HiGraph provides a much-needed benchmark for building more resilient security systems. By capturing both the high-level "social network" of functions and the low-level logic within them, it allows detectors to identify persistent malicious blueprints that survive code evolution. The dataset and tools are publicly available at higraph.org.

Summary updated

Abstract

The advancement of graph-based malware analysis is critically limited by the absence of large-scale datasets that capture the inherent hierarchical structure of software. Existing methods often oversimplify programs into single level graphs, failing to model the crucial semantic relationship between high-level functional interactions and low-level instruction logic. To bridge this gap, we introduce \dataset, the largest public hierarchical graph dataset for malware analysis, comprising over \textbf{200M} Control Flow Graphs (CFGs) nested within \textbf{595K} Function Call Graphs (FCGs). This two-level representation preserves structural semantics essential for building robust detectors resilient to code obfuscation and malware evolution. We demonstrate HiGraph's utility through a large-scale analysis that reveals distinct structural properties of benign and malicious software, establishing it as a foundational benchmark for the community. The dataset and tools are publicly available at https://higraph.org.
BibTeX
@misc{chen2025higraph,
  author = {Han Chen and Hanchen Wang and Hongmei Chen and Ying Zhang and Lu Qin and Wenjie Zhang},
  title = {{HiGraph: A Large-Scale Hierarchical Graph Dataset for Malware Analysis}},
  year = {2025},
  eprint = {2509.02113},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.02113},
}
Figure