Optimizing smart contract vulnerability detection via multi-modality code and entropy embedding

源代码 嵌入 编译程序 计算机科学 编码器 变压器 编码(集合论) 计算机工程 理论计算机科学 人工智能 程序设计语言 工程类 操作系统 集合(抽象数据类型) 电压 电气工程
作者
Dawei Yuan,Xiaohui Wang,Yao Li,Tao Zhang
出处
期刊:Journal of Systems and Software [Elsevier]
卷期号:202: 111699-111699 被引量:6
标识
DOI:10.1016/j.jss.2023.111699
摘要

Smart contracts have been widely used in the blockchain world these years, and simultaneously vulnerability detection has gained more and more attention due to the staggering economic losses caused by the attacker. Existing tools that analyze vulnerabilities for smart contracts heavily rely on rules predefined by experts, which are labour-intense and require domain knowledge. Moreover, predefined rules tend to be misconceptions and increase the risk of crafty potential back-doors in the future. Recently, researchers mainly used static and dynamic execution analysis to detect the vulnerabilities of smart contracts and have achieved acceptable results. However, the dynamic method cannot cover all the program inputs and execution paths, which leads to some vulnerabilities that are hard to detect. The static analysis method commonly includes symbolic execution and theorem proving, which requires using constraints to detect vulnerability. These shortcomings show that traditional methods are challenging to apply and expand on a large scale. This paper aims to detect vulnerabilities via the Bug Injection framework and transfer learning techniques. First, we train a Transformer encoder using multi-modality code, which contains source code, intermediate representation, and assembly code. The input code consists separately of Solidity source code, intermediate representation, and assembly code. Specifically, we translate source code into the intermediate representation and decompile the byte code into assembly code by the EVM compiler. Then, we propose a novel entropy embedding technique, which combines token embedding, segment embedding, and positional embedding of the Transformer encoder in our approach. After that, we utilize the Bug Injection framework to automatically generate specific types of buggy code for fine-tuning and evaluating the performance of vulnerability detection. The experimental results show that our proposed approach improves the performance in detecting reentrancy vulnerabilities and timestamp dependence. Moreover, our approach is more flexible and scalable than static and dynamic analysis approaches in detecting smart contract vulnerabilities. Our approach improves the baseline approaches by an average of 11.89% in term of F1 score.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
1秒前
3秒前
11111完成签到,获得积分10
3秒前
ding应助子不语采纳,获得10
3秒前
3秒前
4秒前
万能图书馆应助橙子采纳,获得10
4秒前
qqqq完成签到,获得积分10
4秒前
5秒前
wd34完成签到 ,获得积分10
6秒前
量子星尘发布了新的文献求助10
6秒前
6秒前
香蕉觅云应助3333采纳,获得10
6秒前
乐乐应助烤麸采纳,获得10
7秒前
8秒前
菜鸟且小白完成签到,获得积分20
8秒前
8秒前
Simon1640发布了新的文献求助10
9秒前
轻松囧发布了新的文献求助10
9秒前
丘比特应助CNYDNZB采纳,获得10
9秒前
城南发布了新的文献求助10
10秒前
九日完成签到,获得积分10
11秒前
11秒前
背后寒烟发布了新的文献求助10
12秒前
小医森完成签到 ,获得积分10
12秒前
平淡伊布发布了新的文献求助10
12秒前
qqqq发布了新的文献求助10
13秒前
13秒前
13秒前
Dr_Seurin完成签到,获得积分10
14秒前
量子星尘发布了新的文献求助10
15秒前
虫子完成签到,获得积分10
17秒前
CipherSage应助无聊的板栗采纳,获得10
17秒前
研友_VZG7GZ应助TOP采纳,获得10
17秒前
典希子发布了新的文献求助30
17秒前
所所应助gao采纳,获得10
18秒前
3333发布了新的文献求助10
18秒前
淡定的海冬完成签到,获得积分10
19秒前
Yeteen完成签到,获得积分10
19秒前
20秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Binary Alloy Phase Diagrams, 2nd Edition 8000
Comprehensive Methanol Science Production, Applications, and Emerging Technologies 2000
Building Quantum Computers 800
Translanguaging in Action in English-Medium Classrooms: A Resource Book for Teachers 700
Exosomes Pipeline Insight, 2025 500
Red Book: 2024–2027 Report of the Committee on Infectious Diseases 500
热门求助领域 (近24小时)
化学 材料科学 生物 医学 工程类 计算机科学 有机化学 物理 生物化学 纳米技术 复合材料 内科学 化学工程 人工智能 催化作用 遗传学 数学 基因 量子力学 物理化学
热门帖子
关注 科研通微信公众号,转发送积分 5656628
求助须知:如何正确求助?哪些是违规求助? 4804442
关于积分的说明 15076544
捐赠科研通 4814884
什么是DOI,文献DOI怎么找? 2576051
邀请新用户注册赠送积分活动 1531356
关于科研通互助平台的介绍 1489936