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

通过拼接实现自动、表达性强且可扩展的模糊测试

Automatic, Expressive, and Scalable Fuzzing with Stitching

Carnegie Mellon University(卡内基梅隆大学)

Harrison Green, Fraser Brown, Claire Le Goues

AI总结:

STITCH通过拼接技术实现自动、表达性强且可扩展的模糊测试,发现更多真实bug并提高精度。

摘要:

模糊测试是一种用于发现软件库中bug的强大技术,但将其扩展仍极具挑战性。自动化Harness生成在合成时固定API序列,限制了每个Harness可以测试的行为。相反,动态探索新序列的方法缺乏表达力,无法建模现实中的使用约束,导致因简单的API误用而产生假阳性。我们提出了拼接技术,该技术将API使用约束编码为碎片,由模糊测试器在运行时动态组装。静态类型系统控制对象在块之间的流动,而动态检查的外在类型状态跟踪任意元数据在块之间,使规范能够表达丰富的语义约束,如对象状态依赖性和跨函数前提条件。这使一个规范能够描述一个开放的API交互空间,模糊测试器在覆盖反馈的引导下进行探索。我们实现了拼接技术,使用LLM自动配置项目进行模糊测试,合成规范,甄别崩溃,并修复规范本身。我们对四个最先进的工具在33个基准测试中进行了评估,其中STITCH在21个基准测试中实现了最高的代码覆盖率,并发现了30个真正的阳性bug,比其他所有工具的总和(10个)高出很多,精度也显著更高(70% vs. 12%)。STITCH自动部署在1365个广泛使用的开源项目上,发现了102个项目中的131个新bug,其中73个已修复。

英文摘要:

Fuzzing is a powerful technique for finding bugs in software libraries, but scaling it remains difficult. Automated harness generation commits to fixed API sequences at synthesis time, limiting the behaviors each harness can test. Approaches that instead explore new sequences dynamically lack the expressiveness to model real-world usage constraints leading to false positives from straightforward API misuse. We propose stitching, a technique that encodes API usage constraints in pieces that a fuzzer dynamically assembles at runtime. A static type system governs how objects flow between blocks, while a dynamically-checked extrinsic typestate tracks arbitrary metadata across blocks, enabling specifications to express rich semantic constraints such as object state dependencies and cross-function preconditions. This allows a single specification to describe an open-ended space of valid API interactions that the fuzzer explores guided by coverage feedback. We implement stitching in STITCH, using LLMs to automatically configure projects for fuzzing, synthesize a specification, triage crashes, and repair the specification itself. We evaluated STITCH against four state-of-the-art tools on 33 benchmarks, where it achieved the highest code coverage on 21 and found 30 true-positive bugs compared to 10 by all other tools combined, with substantially higher precision (70% vs. 12% for the next-best LLM-based tool). Deployed automatically on 1365 widely used open-source projects, STITCH discovered 131 new bugs across 102 projects, 73 of which have already been patched.

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

↑