论文标题
Mando:多级异构图嵌入,用于细粒度检测智能合同漏洞
MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities
论文作者
论文摘要
由不同类型的节点和边缘组成的学习异质图增强了均匀图技术的结果。此类图的一个有趣的示例是代表可能的软件代码执行流的控制流图。由于此类图代表了代码的更多语义信息,因此为这些图形开发技术和工具可能对检测软件中的漏洞的可靠性非常有益。但是,现有的异质图技术仍不足以处理复杂的图形,在处理复杂的图形中,不同类型的节点和边缘数量较大且可变。本文集中于以太坊智能合约,作为由在控制流图和包含不同类型的节点和链接的呼叫图上构建的异质合同图表示的软件代码样本。我们提出了曼多(Mando),这是一种新的异质图表示,以学习这种异质合同图的结构。 Mando提取自定义的Metapaths,该Metapaths在不同类型的节点及其邻居之间建立了关系连接。此外,它开发了一个多米达异构图形注意力网络,以学习不同类型的节点及其在异质合同图中的多层嵌入,它们可以更准确地捕获智能合同的代码语义,并以良好的线条和细度合同级别的合同级别的漏洞级别的范围来捕获智能合同的代码语义。我们对大型智能合约数据集的广泛评估表明,曼多(Mando)在粗粒合同水平上改善了其他技术的脆弱性检测结果。更重要的是,它是第一种基于学习的方法,能够在细粒度的线条层面上识别漏洞,并在F1分数方面将基于代码分析的传统脆弱性检测方法显着提高了11.35%至70.81%。
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. 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.