MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities

Hoang H. Nguyen, Nhat-Minh Nguyen, Chunyao Xie, Zahra Ahmadi, Daniel Kudendo +2 more
8/28/2022
cs.SEcs.LG

Official code: MANDO-Project/ge-sc (35 stars, Solidity, MIT, last commit 2026-04-13).

Abstract

Learning heterogeneous graphs consisting of different types of nodes and edges enhances the results of homogeneous graph techniques. An interesting example of such graphs is control-flow graphs representing possible software code execution flows.

Show full abstract

As such graphs represent more semantic information of code, developing techniques and tools for such graphs can be highly beneficial for detecting vulnerabilities in software for its reliability. However, existing heterogeneous graph techniques are still insufficient in handling complex graphs where the number of different types of nodes and edges is large and variable. This paper concentrates on the Ethereum smart contracts as a sample of software codes represented by heterogeneous contract graphs built upon both control-flow graphs and call graphs containing different types of nodes and links. We propose MANDO, a new heterogeneous graph representation to learn such heterogeneous contract graphs' structures. MANDO extracts customized metapaths, which compose relational connections between different types of nodes and their neighbors. Moreover, it develops a multi-metapath heterogeneous graph attention network to learn multi-level embeddings of different types of nodes and their metapaths in the heterogeneous contract graphs, which can capture the code semantics of smart contracts more accurately and facilitate both fine-grained line-level and coarse-grained contract-level vulnerability detection. Our extensive evaluation of large smart contract datasets shows that MANDO improves the vulnerability detection results of other techniques at the coarse-grained contract level. More importantly, it is the first learning-based approach capable of identifying vulnerabilities at the fine-grained line-level, and significantly improves the traditional code analysis-based vulnerability detection approaches by 11.35% to 70.81% in terms of F1-score.

View on arXivView PDF

Code Implementations(1)

MIT

MANDO is a new heterogeneous graph representation to learn the heterogeneous contract graphs' structures to accurately detect vulnerabilities in smart contract source code at both coarse-grained contract-level and fine-grained line-level.

3519Solidity, PythonJan 23, 20227 months agoMIT
deep-learningethereum-contractgraph-learninggraph-neural-networksheterogeneous-graph-neural-network+3 more

Similar Papers

Cite this paper

@article{nguyen2022mando,
  title  = {MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities},
  author = {Hoang H. Nguyen and Nhat-Minh Nguyen and Chunyao Xie and Zahra Ahmadi and Daniel Kudendo and Thanh-Nam Doan and Lingxiao Jiang},
  year   = {2022},
  eprint = {2208.13252},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2208.13252}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2208.13252.svg)](https://codeofpaper.com/paper/2208.13252)

Discussion