用大模型生成精准测试数据,让漏洞挖掘快近5倍。
Fuzzing: Randomness? Reasoning! Efficient Directed Fuzzing via Large Language Models
- 用大模型分析代码路径,生成可触发漏洞的精准初始数据
- 针对具体漏洞生成专用变异策略,减少盲目尝试
- 实测在8个漏洞上60秒内发现,速度提升2.7到4.8倍
模糊测试因随机性而高效发现漏洞,但随机性也导致效率低下,常需数天甚至数周。尽管定向模糊测试通过引导减少随机性,但种子和变异器仍含大量随机成分,影响效率。为此,本文提出使用大语言模型(LLMs)消除种子随机性、降低变异器随机性。利用其强推理与代码生成能力,生成可达且目标明确的种子,并构建针对特定漏洞的专用变异器。我们提出RandLuzz框架,结合大模型与定向模糊测试,提升种子与变异器质量,实现高效漏洞暴露。该框架通过分析函数调用链或功能逻辑,指导大模型生成可执行种子;并通过漏洞分析获取漏洞成因与变异建议,生成针对性代码变异。在AFLGo、Beacon、WindRanger、SelectFuzz四个先进定向模糊测试工具上的对比实验表明,使用RandLuzz生成的种子,平均提速2.1×至4.8×;在单个漏洞上最高达2.7×提速;在8个漏洞上可在60秒内完成暴露。
原文摘要 · Abstract (English)
Fuzzing is highly effective in detecting bugs due to the key contribution of randomness. However, randomness significantly reduces the efficiency of fuzzing, causing it to cost days or weeks to expose bugs. Even though directed fuzzing reduces randomness by guiding fuzzing towards target buggy locations, the dilemma of randomness still challenges directed fuzzers. Two critical components, which are seeds and mutators, contain randomness and are closely tied to the conditions required for triggering bugs. Therefore, to address the challenge of randomness, we propose to use large language models (LLMs) to remove the randomness in seeds and reduce the randomness in mutators. With their strong reasoning and code generation capabilities, LLMs can be used to generate reachable seeds that target pre-determined locations and to construct bug-specific mutators tailored for specific bugs. We propose RandLuzz, which integrates LLMs and directed fuzzing, to improve the quality of seeds and mutators, resulting in efficient bug exposure. RandLuzz analyzes function call chain or functionality to guide LLMs in generating reachable seeds. To construct bug-specific mutators, RandLuzz uses LLMs to perform bug analysis, obtaining information such as bug causes and mutation suggestions, which further help generate code that performs bug-specific mutations. We evaluate RandLuzz by comparing it with four state-of-the-art directed fuzzers, AFLGo, Beacon, WindRanger, and SelectFuzz. With RandLuzz-generated seeds, the fuzzers achieve an average speedup ranging from 2.1$\times$ to 4.8$\times$ compared to using widely-used initial seeds. Additionally, when evaluated on individual bugs, RandLuzz achieves up to a 2.7$\times$ speedup compared to the second-fastest exposure. On 8 bugs, RandLuzz can even expose them within 60 seconds.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。