一句话:提出 Oracle 引导的 Harness 合成技术,用编译、执行与覆盖率变化作为正确性 Oracle 自动生成语义正确的 C API 模糊测试 Harness。
库 API 是现代软件安全的关键,而基于覆盖率引导的模糊测试高度依赖 harness——在向 API 函数投喂随机输入前完成初始化与调用的包装程序。手工编写 harness 需要深厚领域知识;现有自动「学习」库用法的生成方法虽然覆盖率较高,却常违背 API 语义,产生无效、不真实或不可能的数据与调用序列,引发假阳性崩溃,使许多关键 API 无法被有效 fuzz。本文提出 Oracle 引导的 Harness 合成:从 API 头文件提取信息,通过变异式拼接构造候选 harness,并用三种正确性 Oracle(可编译、可执行、覆盖率发生变化)评估其有效性,只保留正确候选并继续变异,从而在约一小时内为复杂真实库生成多样且语义正确的 harness。原型 OGHARN 在 20 个真实 API 上与领先的自动方法 Hopper 及 OSS-Fuzz 中开发者手写 harness 对比:代码覆盖率中位数高出 14%,分别多发现 31 与 30 个漏洞,且零假阳性崩溃;新发现的 41 个漏洞全部被开发者确认,其中 40 个已修复,许多位于此前完全没有 harness 的 API 中。
Library APIs are used by virtually every modern application and system, making them among today's most security-critical software. In recent years, library bug-finding efforts have overwhelmingly adopted the powerful testing strategy of coverage-guided fuzzing. At its core, API fuzzing operates on harnesses: wrapper programs that initialize an API before feeding random inputs to its functions. Successful fuzzing demands correct and thorough harnesses, making manual harnessing challenging without sufficient domain expertise. To overcome this, recent strategies propose “learning” libraries' intended usage to automatically generate their fuzzing harnesses. Yet, despite their high code coverage, resulting harnesses frequently miss key API semantics-bringing with them invalid, unrealistic, or otherwise-impossible data and call sequences-derailing fuzzing with false-positive crashes. Thus, without a precise, semantically-correct harnessing, many critical APIs will remain beyond fuzzing's reach-leaving their hidden vulnerabilities ripe for attackers. This paper introduces Oracle-guided Harnessing: a technique for fully-automatic, semantics-aware API fuzzing har-ness synthesis. At a high level, Oracle-guided Harnessing mimics the trial-and-error process of manual harness creation-yet au-tomates it via fuzzing. Specifically, we leverage information from API headers to mutationally stitch-together candidate harnesses; and evaluate their validity via a set of Correctness Oracles: compilation, execution, and changes in coverage. By keeping-and further mutating-only correct candidates, our approach produces a diverse set of semantically-correct harnesses for complex, real-world libraries in as little as one hour. We integrate Oracle-guided Harnessing as a prototype, OG HARN; and evaluate it alongside today's leading fully-automatic harnessing approach, Hopper, and a plethora of developer-written harnesses from OSS-Fuzz. Across 20 real-world APIs, OGHARN outperforms developer-written harnesses by a median 14% code coverage, while uncovering 31 and 30 more vulnerabilities than both Hopper and developer-written harnesses, respectively-with zero false-positive crashes. Of the 41 new vulnerabilities found by OGHARN, all 41 are confirmed by developers-40 of which are since fixed-with many found in APIs that, until now, lacked harnesses whatsoever.
DOI 原文 ·
@inproceedings{paperbot8720,
title = {No Harness, No Problem: Oracle-guided Harnessing for Auto-generating C API Fuzzing Harnesses},
author = {Gabriel Sherman and Stefan Nagy},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00239}
}