arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.08616cs.SEcs.CR
收藏

面向 Java 库的覆盖引导多智能体模糊生成

Coverage-Guided Multi-Agent Harness Generation for Java Library Fuzzing

University of Lübeck(吕贝克大学)

Nils Loose, Nico Winkel, Kristoffer Hempel, Felix Mächtle, Julian Hans, Thomas Eisenbarth

AI总结:

本文提出一种多智能体架构,通过 LLM 功能智能体自动化生成 Java 库的模糊 harnesses,提升模糊测试效率并发现漏洞。

摘要:

覆盖引导模糊测试已证明在软件测试中有效,但针对库代码需要专门的模糊 harnesses,将模糊器生成的输入转换为有效的 API 调用。手动创建 harnesses 是耗时的,需要深入理解 API 语义、初始化序列和异常处理合同。我们提出了一种多智能体架构,通过专门的 LLM 功能智能体自动化生成 Java 库的模糊 harnesses。五个 ReAct 智能体将工作流程分解为研究、合成、编译修复、覆盖分析和细化。而不是预处理整个代码库,智能体通过模型上下文协议按需查询文档、源代码和调用图信息,在探索复杂依赖时保持专注的上下文。为了实现有效的细化,我们引入了方法导向的覆盖,仅在目标方法执行期间跟踪覆盖以隔离目标行为,并引入了智能体引导的终止,通过检查未覆盖的源代码来区分有成效的细化机会和 diminishing returns。我们在六个广泛部署的 Java 库的七个目标方法上评估了我们的方法,总计有 115,000+ Maven 依赖。我们生成的 harnesses 在 OSS-Fuzz 基线下实现了中位 26% 的改进,并在包作用域覆盖上优于 Jazzer AutoFuzz 5%。生成成本平均为 3.20 美元和 10 分钟每个 harness,使该方法适用于持续模糊测试工作流程。在 12 小时的模糊测试活动中,我们生成的 harnesses 在已集成到 OSS-Fuzz 的项目中发现了 3 个漏洞,证明了生成的 harnesses 的有效性。

英文摘要:

Coverage-guided fuzzing has proven effective for software testing, but targeting library code requires specialized fuzz harnesses that translate fuzzer-generated inputs into valid API invocations. Manual harness creation is time-consuming and requires deep understanding of API semantics, initialization sequences, and exception handling contracts. We present a multi-agent architecture that automates fuzz harness generation for Java libraries through specialized LLM-powered agents. Five ReAct agents decompose the workflow into research, synthesis, compilation repair, coverage analysis, and refinement. Rather than preprocessing entire codebases, agents query documentation, source code, and callgraph information on demand through the Model Context Protocol, maintaining focused context while exploring complex dependencies. To enable effective refinement, we introduce method-targeted coverage that tracks coverage only during target method execution to isolate target behavior, and agent-guided termination that examines uncovered source code to distinguish productive refinement opportunities from diminishing returns. We evaluated our approach on seven target methods from six widely-deployed Java libraries totaling 115,000+ Maven dependents. Our generated harnesses achieve a median 26\% improvement over OSS-Fuzz baselines and outperform Jazzer AutoFuzz by 5\% in package-scope coverage. Generation costs average \$3.20 and 10 minutes per harness, making the approach practical for continuous fuzzing workflows. During a 12-hour fuzzing campaign, our generated harnesses discovered 3 bugs in projects that are already integrated into OSS-Fuzz, demonstrating the effectiveness of the generated harnesses.

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

↑