paperbot · PL 论文追踪

全部论文 待读 收藏

P2 No Harness, No Problem: Oracle-guided Harnessing for Auto-generating C API Fuzzing Harnesses

没有 Harness 也无妨:Oracle 引导的 C API 模糊测试 Harness 自动合成
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 1/10 · 该论文属于模糊测试与测试用例(harness)自动合成的动态分析方向,与用户核心的静态分析、浮点程序分析、贝叶斯程序分析均无交集,且完全未涉及 LLM/Agent。虽然其“Oracle 引导的合成”在方法上可归入程序合成,也与用户偏好工程实现相符,但研究目标与技术手段都不在其研究画像的四个方向内。引用 3 inbox
Gabriel Sherman, Stefan Nagy
crossref: 2026-09-12

AI 速览

一句话:提出 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 中。

问题
手工编写 API fuzzing harness 需要足够的领域专家知识,而现有自动生成方法虽覆盖率高,却常违反 API 语义、产生无效调用序列,导致假阳性崩溃,使大量关键 API 无法被有效模糊测试。
方法
以 Oracle 引导的方式模拟人工试错:从 API 头文件信息出发,通过变异式拼接生成候选 harness,并用编译、执行以及覆盖率变化这三类正确性 Oracle 判定其有效性,仅保留正确候选继续变异,实现完全自动、语义感知的 harness 合成。
评估
实现原型 OGHARN,在 20 个真实 API 上与全自动方法 Hopper 及 OSS-Fuzz 中开发者手写 harness 对比:代码覆盖率中位数提升 14%,分别多发现 31 与 30 个漏洞,且无假阳性崩溃。
原文摘要(Abstract)

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 原文 ·

BibTeX
@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}
}