论文精选73°

大模型自动注入智能合约漏洞

Automated Vulnerability Injection in Smart Contracts Using Large Language Models

精选理由

论文展示用大模型自动生成带漏洞的智能合约,帮助测试安全工具,发现现有分析工具的局限性。

AI 摘要

研究人员提出使用大模型自动向Solidity智能合约注入漏洞的方法。该方法针对OpenSCV的49种漏洞类型进行测试,从SmartBugs真实合约生成近1000个候选变体。经去重和验证后,确认32个包含25种漏洞类型的合约(存活率16.58%)。研究团队使用这些合约评估了三种静态分析工具,揭示了它们互补且不完整的覆盖特性。

原文 · arXiv cs.AI

Automated Vulnerability Injection in Smart Contracts Using Large Language Models

Assessing vulnerability detection tools for smart contracts requires datasets with known ground truth, yet such datasets are scarce and difficult to build by hand. We propose an approach that uses Large Language Models (LLMs) to automatically inject vulnerabilities into Solidity smart contracts, and demonstrate it in a case study targeting 49 vulnerability types from OpenSCV. Injected contracts are validated through a multi-step pipeline checking compilation, execution, business logic, and the presence of the intended vulnerability. Applied to real-world contracts from SmartBugs, LLMs generate nearly 1,000 candidate variants; after deduplication and validation, 32 confirmed vulnerable contracts spanning 25 vulnerability types survive (a 16.58% survival rate). Surviving contracts concentrate in structurally simpler targets and vulnerability types with localized syntactic patterns. We report practical challenges including LLMs' non-determinism and the difficulty of preserving contract semantics. We then use the validated contracts to assess three static analyzers, revealing complementary and incomplete coverage profiles. Results show that LLM-based vulnerability injection is feasible, while exposing key limitations in scalability and diversity.