arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2101.02377cs.CRcs.LGcs.SE
收藏

Eth2Vec:学习合约范围的代码表示,用于以太坊智能合约的漏洞检测

Eth2Vec: Learning Contract-Wide Code Representations for Vulnerability Detection on Ethereum Smart Contracts

Osaka University(大阪大学);National Institute of Technology, Nara College(奈良工业高等专门学校)

Nami Ashizawa, Naoto Yanai, Jason Paul Cruz, Shingo Okamura

摘要:

以太坊智能合约是在以太坊区块链上运行的程序,在过去十年中发现了许多智能合约漏洞。已经创建了许多安全分析工具来检测此类漏洞,但是当要分析的代码被重写时,它们的性能急剧下降。在本文中,我们提出了Eth2Vec,这是一种基于机器学习的静态分析工具,用于漏洞检测,对智能合约中的代码重写具有鲁棒性。现有的基于机器学习的漏洞检测静态分析工具需要分析人员手动创建的特征作为输入。相比之下,Eth2Vec通过用于语言处理的神经网络自动学习具有隐性知识的易受攻击的以太坊虚拟机(EVM)字节码的特征。因此,Eth2Vec可以通过比较目标EVM字节码与其已经学习的EVM字节码之间的代码相似度来检测智能合约中的漏洞。我们对现有的开放数据库(如Etherscan)进行了实验,结果表明Eth2Vec在众所周知的指标方面优于现有的工作,即,精确度、召回率和F1分数。此外,Eth2Vec甚至可以检测重写代码中的漏洞。

英文摘要:

Ethereum smart contracts are programs that run on the Ethereum blockchain, and many smart contract vulnerabilities have been discovered in the past decade. Many security analysis tools have been created to detect such vulnerabilities, but their performance decreases drastically when codes to be analyzed are being rewritten. In this paper, we propose Eth2Vec, a machine-learning-based static analysis tool for vulnerability detection, with robustness against code rewrites in smart contracts. Existing machine-learning-based static analysis tools for vulnerability detection need features, which analysts create manually, as inputs. In contrast, Eth2Vec automatically learns features of vulnerable Ethereum Virtual Machine (EVM) bytecodes with tacit knowledge through a neural network for language processing. Therefore, Eth2Vec can detect vulnerabilities in smart contracts by comparing the code similarity between target EVM bytecodes and the EVM bytecodes it already learned. We conducted experiments with existing open databases, such as Etherscan, and our results show that Eth2Vec outperforms the existing work in terms of well-known metrics, i.e., precision, recall, and F1-score. Moreover, Eth2Vec can detect vulnerabilities even in rewritten codes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑