arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.01742cs.CRcs.SE
收藏

知识超越参数:演化智能合约漏洞检测

Knowledge Over Parameters: Evolving Smart Contract Vulnerability Detection

Nanyang Technological University(南洋理工大学);Nankai University(南开大学);University of California, Los Angeles(加州大学洛杉矶分校);Imperial College London(伦敦帝国学院);Singapore Management University(新加坡管理大学)

Yuqiang Sun, Han Liu, Ying Li, Yiran Zhang, Zong Cao, Ziyun Guo, Yang Liu

AI总结:

提出EvoVuln框架,将漏洞检测转化为程序性知识演化问题,通过运行时反转控制架构和两阶段演化流水线,仅用少量标注样本自动合成并优化检测逻辑,在五种真实漏洞类型上实现71%宏平均F1分数。

摘要:

智能合约漏洞主要是逻辑错误,其检测需要关于攻击模式和合约语义的结构化、逐步的程序性知识。现有的基于LLM的方法难以自动生成这些知识:基于提示的方法依赖手动编写的检测规则,而微调需要大量标注数据集,这在领域中本就稀缺。我们提出EvoVuln,一个自动化框架,将漏洞检测重构为程序性知识演化问题,仅使用最少量的标注样本来合成和优化检测逻辑。为此,EvoVuln引入了两个关键机制。首先,一个具有控制反转(IoC)架构的运行时将检测规则编译为可执行策略。这严格解耦了确定性控制流与LLM语义推理,确保忠实的逻辑遵循,并产生密集的诊断遥测以进行精确的错误定位。其次,一个两阶段演化流水线通过溯因语义调试来优化规则,无需任何参数更新:冷启动阶段使用自动合成的边界案例引导并压力测试初始规则;少样本演化阶段仅使用每种漏洞类型的五个易受攻击和五个安全示例,将策略基于真实世界语义。在五种真实世界漏洞类型上的评估中,EvoVuln实现了71%的宏平均F1分数,优于所有基线。演化出的程序性知识可跨模型移植:它使一个轻量级、低成本的模型超越一个更大的零样本模型19个百分点,并且无需重新训练即可转移到其他LLM,一次性演化成本低于50美元。

英文摘要:

Smart contract vulnerabilities are predominantly logic bugs whose detection requires structured, step-by-step procedural knowledge of attack patterns and contract semantics. Existing LLM-based methods struggle to generate this knowledge automatically: prompt-based methods rely on manually crafted detection rules, while fine-tuning requires massive labeled datasets that are inherently scarce in this domain. We present EvoVuln, an automated framework that reformulates vulnerability detection as a procedural knowledge evolution problem, synthesizing and refining detection logic using only a minimal number of labeled samples. To achieve this, EvoVuln introduces two key mechanisms. First, a Runtime with an Inversion of Control (IoC) architecture compiles detection rules into Executable Policies. This strictly decouples deterministic control flow from LLM semantic reasoning, ensuring faithful logical adherence and producing dense diagnostic telemetry for precise error localization. Second, a two-phase evolution pipeline refines the rule via abductive semantic debugging without any parameter updates: Cold Start bootstraps and stress-tests an initial rule using auto-synthesized corner cases; Few-Shot Evolving then grounds the policy in real-world semantics using only five vulnerable and five safe examples per vulnerability type. Evaluated across five real-world vulnerability types, EvoVuln achieves a 71% macro-average F1-score, outperforming all baselines. The evolved procedural knowledge is portable across models: it enables a lightweight, low-cost model to surpass a much larger zero-shot model by 19 percentage points, and transfers to other LLMs without retraining, at a one-time evolution cost under $50.

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

↑