arXiv:2409.04597cs.SEcs.LG2024-09被引 4

用自决策大模型提升智能合约漏洞检测效率,发现长期未被识别的深层漏洞。

Detecting Buggy Contracts via Smart Testing

  • 引入交互式大模型动态选择最佳测试策略,避免性能瓶颈
  • 在真实数据集上覆盖率提升14.3%,发现11个工具漏检的严重漏洞
  • 适合安全研究人员和区块链开发团队用于深度漏洞挖掘

智能合约易受严重漏洞影响。混合动态分析技术(如结合符号执行的模糊测试、基于大模型的模糊测试)近年来成为高效检测智能合约漏洞的重要手段。尽管该方法在实际基准测试中初显成效,但面对复杂代码模式中的深层漏洞时仍存在可扩展性不足的问题。我们观察到,现有动态分析的性能瓶颈与大模型幻觉是制约其发现深层漏洞的主要因素。为此,我们设计了一个交互式、自决策的大模型系统 SmartSys,用于支持混合智能合约动态分析。核心思想是让大模型学习不同动态分析技术的性能瓶颈,从而预测最优分析策略并生成能触及深层隐藏漏洞的有效模糊测试目标。为消除错误的模糊测试目标,SmartSys在编译阶段和运行时向大模型提供动态分析反馈。实验结果表明:i) 成功发现一个已逃避11种工具检测、历经多次审计超过一年的协议漏洞;ii) 在真实世界基准测试中,相比基线方法最高提升14.3%的代码覆盖率。

原文摘要 · Abstract (English)

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.

智能合约漏洞检测大模型模糊测试

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。