We introduce Deep Learning Vulnerability Analyzer (DLVA), a vulnerability detection tool for Ethereum smart contracts based on powerful deep learning techniques for sequential data adapted for bytecode. We train DLVA to judge bytecode even though the supervising oracle, Slither, can only judge source code. DLVA's training algorithm is general: we "extend" a source code analysis to bytecode without any manual feature engineering, predefined patterns, or expert rules. DLVA's training algorithm is also robust: it overcame a 1.25% error rate mislabeled contracts, and the student surpassing the teacher; found vulnerable contracts that Slither mislabeled. In addition to extending a source code analyzer to bytecode, DLVA is much faster than conventional tools for smart contract vulnerability detection based on formal methods: DLVA checks contracts for 29 vulnerabilities in 0.2 seconds, a speedup of 10-500x+ compared to traditional tools. DLVA has three key components. Smart Contract to Vector (SC2V) uses neural networks to map arbitrary smart contract bytecode to an high-dimensional floating-point vector. Sibling Detector (SD) classifies contracts when a target contract's vector is Euclidian-close to a labeled contract's vector in a training set; although only able to judge 55.7% of the contracts in our test set, it has an average accuracy of 97.4% with a false positive rate of only 0.1%. Lastly, Core Classifier (CC) uses neural networks to infer vulnerable contracts regardless of vector distance. DLVA has an overall accuracy of 96.6% with an associated false positive rate of only 3.7%.
翻译:我们提出深度学习的漏洞分析工具(DLVA),这是一种基于针对字节码优化的强大序列深度学习技术的以太坊智能合约漏洞检测工具。尽管监督预言机Slither仅能分析源代码,但我们训练DLVA直接判断字节码。DLVA的训练算法具有通用性:无需任何手动特征工程、预定义模式或专家规则,即可将源代码分析"扩展"至字节码。其训练算法同样具备鲁棒性:成功克服了1.25%的错误标注合约,实现学生超越教师——发现了被Slither误判为安全的漏洞合约。除将源代码分析扩展至字节码外,DLVA相比基于形式化方法的传统智能合约漏洞检测工具快得多:可在0.2秒内完成29类漏洞检测,速度提升达10-500倍以上。DLVA包含三个核心组件:智能合约向量化(SC2V)模块利用神经网络将任意智能合约字节码映射至高维浮点向量;兄弟检测器(SD)模块在目标合约向量与训练集中已标注合约向量呈欧几里得距离相近时进行分类——尽管仅能判定测试集中55.7%的合约,但其平均准确率达97.4%,误报率仅0.1%;核心分类器(CC)模块则不受向量距离限制,通过神经网络推断存在漏洞的合约。DLVA总体准确率达96.6%,误报率仅为3.7%。