用大模型生成有语义的测试输入,更快发现软件漏洞。
Hybrid Fuzzing with LLM-Guided Input Mutation and Semantic Feedback
- 用大模型根据程序结构生成语法正确且语义多样的输入
- 通过程序状态变化等信号识别新行为,比单纯覆盖代码更有效
- 适合需要深度探索漏洞的网络安全研究者
软件模糊测试已成为自动化漏洞发现的核心技术,但现有变异策略缺乏语义感知,导致测试用例重复、深入程序状态的探索速度慢。本文提出一种混合模糊测试框架,结合静态与动态分析,利用大语言模型(LLM)指导输入变异并引入语义反馈。静态分析提取控制流与数据流信息,转化为结构化提示,驱动LLM生成语法合法且语义多样输入;运行时在传统覆盖率反馈基础上,加入由程序状态变化、异常类型和输出语义衍生的语义反馈信号,使模糊测试器优先选择能触发新颖程序行为的输入。我们在AFL++基础上实现该方法,结合程序插桩与基于嵌入的语义相似性度量进行种子筛选。在libpng、tcpdump和sqlite等真实开源目标上的评估表明,本方法在首次发现漏洞的时间上更优,语义多样性更高,且发现的独特漏洞数量达到当前先进模糊测试工具的水平。该工作展示了将大模型推理与语义感知反馈结合,可加速并深化漏洞发现。
原文摘要 · Abstract (English)
Software fuzzing has become a cornerstone in automated vulnerability discovery, yet existing mutation strategies often lack semantic awareness, leading to redundant test cases and slow exploration of deep program states. In this work, I present a hybrid fuzzing framework that integrates static and dynamic analysis with Large Language Model (LLM)-guided input mutation and semantic feedback. Static analysis extracts control-flow and data-flow information, which is transformed into structured prompts for the LLM to generate syntactically valid and semantically diverse inputs. During execution, I augment traditional coverage-based feedback with semantic feedback signals-derived from program state changes, exception types, and output semantics-allowing the fuzzer to prioritize inputs that trigger novel program behaviors beyond mere code coverage. I implement our approach atop AFL++, combining program instrumentation with embedding-based semantic similarity metrics to guide seed selection. Evaluation on real-world open-source targets, including libpng, tcpdump, and sqlite, demonstrates that our method achieves faster time-to-first-bug, higher semantic diversity, and a competitive number of unique bugs compared to state-of-the-art fuzzers. This work highlights the potential of combining LLM reasoning with semantic-aware feedback to accelerate and deepen vulnerability discovery.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。