arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.04597cs.SEcs.LGcs.PL

通过智能测试检测有缺陷的合约

Detecting Buggy Contracts via Smart Testing

Columbia University(哥伦比亚大学);The University of Chicago(芝加哥大学)

Sally Junsong Wang, Jianan Yao, Kexin Pei, Hidedaki Takahashi, Junfeng Yang

AI总结:

针对混合动态分析难发现智能合约深层缺陷的问题,本文提出可自主决策的 SmartSys,利用基础模型选择分析技术、生成模糊目标并结合动态反馈抑制幻觉,发现长期遗漏漏洞并提升覆盖率。

摘要:

智能合约容易受到严重漏洞的影响。混合动态分析(例如 concolic execution 辅助的模糊测试和基础模型辅助的模糊测试)近来已成为用于智能合约缺陷检测的高效测试技术。这种混合方法在真实世界基准测试中已显示出初步前景,但在发现隐藏于复杂代码模式中的深层缺陷方面,仍存在可扩展性较低的问题。我们观察到,现有动态分析的性能瓶颈和模型幻觉,是限制这种混合方法发现深层缺陷可扩展性的两个主要因素。为克服这些挑战,我们设计了一个交互式、可自主决策的基于基础模型的系统,名为 SmartSys,以支持混合智能合约动态分析。其核心思想是让基础模型了解不同动态分析技术的性能瓶颈,从而能够预测正确的技术,并生成可触及深层、隐藏缺陷的有效模糊测试目标。为剪除幻觉产生的错误模糊测试目标,SmartSys 在编译期间和运行时向基础模型提供来自动态分析的反馈。SmartSys 的有趣结果包括:i)发现了一个逃过十一种工具检查、并在多次审计中存在超过一年的智能合约协议漏洞;ii)与基线相比,在真实世界基准测试上将覆盖率最高提升了14.3%。

英文摘要:

Smart contracts are susceptible to critical vulnerabilities. Hybrid dynamic analyses, such as concolic execution assisted fuzzing and foundation model assisted fuzzing, have emerged as highly effective testing techniques for smart contract bug detection recently. This hybrid approach has shown initial promise in real-world benchmarks, but it still suffers from low scalability to find deep bugs buried in complex code patterns. We observe that performance bottlenecks of existing dynamic analyses and model hallucination are two main factors limiting the scalability of this hybrid approach in finding deep bugs. To overcome the challenges, we design an interactive, self-deciding foundation model based system, called SmartSys, to support hybrid smart contract dynamic analyses. The key idea is to teach foundation models about performance bottlenecks of different dynamic analysis techniques, making it possible to forecast the right technique and generates effective fuzz targets that can reach deep, hidden bugs. To prune hallucinated, incorrect fuzz targets, SmartSys feeds foundation models with feedback from dynamic analysis during compilation and at runtime. The interesting results of SmartSys include: i) discovering a smart contract protocol vulnerability that has escaped eleven tools and survived multiple audits for over a year; ii) improving coverage by up to 14.3\% on real-world benchmarks compared to the baselines.

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

↑