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

祝大家在新的一年里科研腾飞
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
wsyiming完成签到,获得积分10
刚刚
亗sui发布了新的文献求助10
1秒前
2秒前
英姑应助三只兔子采纳,获得10
2秒前
ash发布了新的文献求助10
2秒前
2秒前
古风发布了新的文献求助10
2秒前
3秒前
幽默书瑶发布了新的文献求助10
5秒前
大个应助xiaodu采纳,获得10
7秒前
123发布了新的文献求助10
7秒前
zdd完成签到,获得积分10
7秒前
自洽发布了新的文献求助10
8秒前
power完成签到,获得积分10
8秒前
亗sui完成签到,获得积分10
8秒前
8秒前
9秒前
10秒前
赘婿应助侠侠大王采纳,获得10
11秒前
13秒前
13秒前
舒服的寒松完成签到 ,获得积分10
13秒前
大方的乌冬面完成签到 ,获得积分10
14秒前
伶俐黄豆应助xiaobai123456采纳,获得10
15秒前
Inevitable发布了新的文献求助10
15秒前
调皮的笑阳完成签到 ,获得积分10
15秒前
16秒前
20秒前
脑洞疼应助hh采纳,获得10
20秒前
由凡发布了新的文献求助10
21秒前
21秒前
Mic应助ash采纳,获得10
22秒前
CorrectSTH完成签到,获得积分10
24秒前
Owen应助xiao采纳,获得10
26秒前
26秒前
zoushiyi完成签到 ,获得积分10
29秒前
Inevitable完成签到,获得积分10
30秒前
30秒前
禾风完成签到,获得积分10
30秒前
地形图完成签到 ,获得积分10
34秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Operational Bulk Evaporation Duct Model for MORIAH Version 1.2 1200
Variants in Economic Theory 1000
Signals, Systems, and Signal Processing 880
Yangtze Reminiscences. Some Notes And Recollections Of Service With The China Navigation Company Ltd., 1925-1939 800
Discrete-Time Signals and Systems 510
Clinical Efficacy of the Hydrogel Patch Containing Loxoprofen Sodium (LX-A) on Osteoarthritis of the Knee-A Randomized, Open Label Clinical Study with Ketoprofen Patch-(Phase III Therapeutic Confirmatory Study) 410
热门求助领域 (近24小时)
化学 材料科学 生物 医学 工程类 计算机科学 有机化学 物理 生物化学 纳米技术 复合材料 内科学 化学工程 人工智能 催化作用 遗传学 数学 基因 量子力学 物理化学
热门帖子
关注 科研通微信公众号,转发送积分 5842960
求助须知:如何正确求助?哪些是违规求助? 6177670
关于积分的说明 15610714
捐赠科研通 4960102
什么是DOI,文献DOI怎么找? 2674103
邀请新用户注册赠送积分活动 1618937
关于科研通互助平台的介绍 1574172