Skip to main content
QUICK REVIEW

[论文解读] Towards Safer Smart Contracts: A Sequence Learning Approach to Detecting Security Threats

Wesley Joon-Wie Tann, Xing Han|arXiv (Cornell University)|Nov 16, 2018
Advanced Malware Detection Techniques参考文献 46被引用 74
一句话总结

该论文提出基于 LSTM 的方法,在以太坊字节码层面检测智能合约安全威胁,在测试准确率接近 99%,并在 620,000 份合约上超越符号工具 Maian。

ABSTRACT

Symbolic analysis of security exploits in smart contracts has demonstrated to be valuable for analyzing predefined vulnerability properties. While some symbolic tools perform complex analysis steps, they require a predetermined invocation depth to search vulnerable execution paths, and the search time increases with depth. The number of contracts on blockchains like Ethereum has increased 176 fold since December 2015. If these symbolic tools fail to analyze the increasingly large number of contracts in time, entire classes of exploits could cause irrevocable damage. In this paper, we aim to have safer smart contracts against emerging threats. We propose the approach of sequential learning of smart contract weaknesses using machine learning---long-short term memory (LSTM)---that allows us to be able to detect new attack trends relatively quickly, leading to safer smart contracts. Our experimental studies on 620,000 smart contracts prove that our model can easily scale to analyze a massive amount of contracts; that is, the LSTM maintains near constant analysis time as contracts increase in complexity. In addition, our approach achieves $99\%$ test accuracy and correctly analyzes contracts that were false positive (FP) errors made by a symbolic tool.

研究动机与目标

  • 在部署的智能合约数量持续上升和以太坊上不可逆漏洞增多的背景下,推动更安全的智能合约。
  • 提出一种用于快速威胁检测的基于机器学习的替代方法,以替代符号分析。
  • 在大规模以太坊合约数据集上评估可扩展性和检测准确性。
  • 展示 LSTM 能在漏洞检测方面达到或超过现有符号工具的性能。

提出的方法

  • 使用 LSTM 对以太坊字节码序列建模一个二分类的威胁检测问题。
  • 通过嵌入表示对指令进行向量化,以捕捉指令之间的语义关系。
  • 在大数据集(62万份合约)上进行训练和评估,通过 SMOTE 及重采样实现类别平衡。
  • 对二分类使用二元交叉熵损失,并采用基于嵌入的字节码序列输入表示。
  • 将性能与 Maian 符号分析工具进行比较,并报告准确率、F1、以及误报恢复等指标。

实验结果

研究问题

  • RQ1基于字节码序列的 LSTM 模型是否能检测以太坊智能合约中的安全威胁?
  • RQ2基于 LSTM 的方法在准确性和可扩展性方面与 Maian 等符号分析工具相比如何?
  • RQ3该模型能否恢复符号工具识别的误报并随时间检测到新的威胁模式?
  • RQ4随着数据集规模的增长,在分析大量合约时,该方法的可扩展性如何?
  • RQ5字节码嵌入在捕捉与漏洞相关的语义关系中扮演何种角色?

主要发现

  • 该 LSTM 模型在评估集上实现了大约 99% 的测试准确率。
  • 在漏洞检测方面其 F1 分数大约为 86%。
  • 该方法能够检测到 Maian 将之错误标记为否定的约 92.86% 的具有挑战性的合约。
  • 随着合约复杂度的增加,LSTM 的分析时间近乎恒定,从而实现对大规模合约群体的可扩展分析。
  • LSTM 可以作为对符号分析工具的有力替代,为更安全的智能合约提供竞争性解决方案。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。