arXiv:2508.20340cs.SEcs.AI2025-08中稿 · ASPLOS 2026被引 1

用大模型生成可复用逻辑项,高效发现SMT求解器漏洞

Once4All: Skeleton-Guided SMT Solver Fuzzing with LLM-Synthesized Generators

  • 通过大模型提取语法和生成可组合的逻辑表达式
  • 在两个主流求解器中发现43个漏洞,40个已修复
  • 只需一次大模型交互,大幅降低运行开销

SMT求解器是现代系统与编程语言研究的基础,支撑符号执行和自动化验证等任务。由于其处于关键路径,正确性至关重要,高质量测试公式对发现缺陷尤为关键。然而,以往测试方法在早期版本有效,难以跟上快速演进的功能。近期基于大语言模型(LLMs)的方法虽有潜力,但存在两大瓶颈:近半数生成公式语法无效,且与大模型的迭代交互带来显著计算开销。本文提出Once4All,一种新颖的LLM辅助模糊测试框架,通过从直接生成公式转向合成可重用项的生成器来解决上述问题。具体而言,Once4All利用大模型(1)自动从文档中提取支持的理论(包括求解器特有扩展)的上下文无关文法(CFG),(2)合成符合这些文法的可组合布尔项生成器。模糊测试过程中,Once4All将生成的项填充到由现有公式导出的结构骨架中,确保语法正确性并促进语义多样性。值得注意的是,Once4All仅需一次性的大模型交互投入,显著降低运行成本。我们在两个领先的SMT求解器Z3和cvc5上进行了评估,结果表明,Once4All共发现了43个已确认的漏洞,其中40个已被开发者修复。

原文摘要 · Abstract (English)

Satisfiability Modulo Theory (SMT) solvers are foundational to modern systems and programming languages research, providing the foundation for tasks like symbolic execution and automated verification. Because these solvers sit on the critical path, their correctness is essential, and high-quality test formulas are key to uncovering bugs. However, while prior testing techniques performed well on earlier solver versions, they struggle to keep pace with rapidly evolving features. Recent approaches based on Large Language Models (LLMs) show promise in exploring advanced solver capabilities, but two obstacles remain: nearly half of the generated formulas are syntactically invalid, and iterative interactions with LLMs introduce substantial computational overhead. In this study, we present Once4All, a novel LLM-assisted fuzzing framework that addresses both issues by shifting from direct formula generation to the synthesis of generators for reusable terms (i.e., logical expressions). Specifically, Once4All uses LLMs to (1) automatically extract context-free grammars (CFGs) for SMT theories, including solver-specific extensions, from documentation, and (2) synthesize composable Boolean term generators that adhere to these grammars. During fuzzing, Once4All populates structural skeletons derived from existing formulas with the terms iteratively produced by the LLM-synthesized generators. This design ensures syntactic validity while promoting semantic diversity. Notably, Once4All requires only one-time LLM interaction investment, dramatically reducing runtime cost. We evaluated Once4All on two leading SMT solvers: Z3 and cvc5. Our experiments show that Once4All has identified 43 confirmed bugs, 40 of which have already been fixed by developers.

SMT求解器大模型模糊测试代码漏洞

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