arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2104.12064cs.SE
收藏

RULF:通过API依赖图训练的Rust库模糊化

RULF: Rust Library Fuzzing via API Dependency Graph Traversal

Jianfeng Jiang, Hui Xu, Yangfan Zhou

摘要:

鲁棒性是Rust库开发的一个关键问题,因为Rust承诺如果开发人员只使用安全的API,就不会有未定义行为的风险。Fuzzing是一种检验程序健壮性的实用方法。然而,由于缺乏模糊目标,现有的模糊工具不能直接应用于库API。模糊目标的设计主要依靠人工逐个设计,劳动强度大。为了解决这个问题,本文提出了一种新的自动模糊目标生成方法,通过API依赖图遍历模糊Rust库。我们确定了图书馆模糊化的几个基本要求,包括模糊目标的有效性和有效性,高API覆盖率和效率。为了满足这些要求,我们首先采用宽度优先搜索修剪找到API序列的长度阈值下,然后我们向后搜索更长的序列未覆盖的API,最后我们优化的序列集作为一个集合覆盖问题。我们实现了我们的模糊目标生成器,并进行模糊实验与AFL++在几个现实世界中流行的Rust项目。我们的工具最终为每个库生成7到118个模糊目标,API覆盖率高达0.92。我们以24小时为阈值对每个目标进行了测试,并从7个库中找到了30个以前未知的bug。

英文摘要:

Robustness is a key concern for Rust library development because Rust promises no risks of undefined behaviors if developers use safe APIs only. Fuzzing is a practical approach for examining the robustness of programs. However, existing fuzzing tools are not directly applicable to library APIs due to the absence of fuzz targets. It mainly relies on human efforts to design fuzz targets case by case which is labor-intensive. To address this problem, this paper proposes a novel automated fuzz target generation approach for fuzzing Rust libraries via API dependency graph traversal. We identify several essential requirements for library fuzzing, including validity and effectiveness of fuzz targets, high API coverage, and efficiency. To meet these requirements, we first employ breadth-first search with pruning to find API sequences under a length threshold, then we backward search longer sequences for uncovered APIs, and finally we optimize the sequence set as a set covering problem. We implement our fuzz target generator and conduct fuzzing experiments with AFL++ on several real-world popular Rust projects. Our tool finally generates 7 to 118 fuzz targets for each library with API coverage up to 0.92. We exercise each target with a threshold of 24 hours and find 30 previously-unknown bugs from seven libraries.

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

↑