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

面向Rust泛型API的模糊测试驱动程序合成

Fuzz Driver Synthesis for Rust Generic APIs

Yehong Zhang, Jun Wu, Hui Xu

AI总结:

针对现有方法无法为Rust泛型API生成有效模糊测试驱动的问题,本文通过扩展API依赖图、结合类型约束求解与相似度过滤的方法,实现了高泛型API覆盖率和低无效驱动率,还发现了23个未知漏洞。

摘要:

模糊测试是一种流行的漏洞检测技术,通过使用随机输入测试软件可执行文件来实现。该技术也可以通过构建调用库API的可执行文件(即模糊测试驱动程序)扩展到库的测试中。自动化模糊测试驱动程序合成是近年来的重要研究方向,因为它可以简化库的模糊测试流程。然而,现有方法通常忽略泛型API,或者仅将其视为普通API,因此无法为泛型API生成有效的模糊测试驱动程序。\n本文研究了含泛型API的Rust库的自动化模糊测试驱动程序合成问题。该问题至关重要,因为Rust强调安全性,且泛型API在Rust crate(Rust包管理单元)中被广泛使用。只要满足类型约束,每个泛型API都可以有大量单态化版本。该问题的核心挑战在于对这些单态化版本进行优先级排序,并为其提供有效输入。为解决该问题,我们扩展了现有的API依赖图以支持泛型API。通过求解这些依赖关系和类型约束,我们可以生成一组候选单态化API。此外,我们应用基于相似度的过滤器来剪枝冗余版本,尤其是当多个单态化API采用完全相同的trait实现时。针对29个流行开源库的实验结果表明,我们的方法能够实现可观的泛型API覆盖率,且无效模糊测试驱动程序的占比很低。此外,我们在这些库中发现了23个此前未知的漏洞,其中18个与泛型API相关。

英文摘要:

Fuzzing is a popular bug detection technique achieved by testing software executables with random inputs. This technique can also be extended to libraries by constructing executables that call library APIs, known as fuzz drivers. Automated fuzz driver synthesis has been an important research topic in recent years since it can facilitate the library fuzzing process. Nevertheless, existing approaches generally ignore generic APIs or simply treat them as normal APIs. As a result, they cannot generate effective fuzz drivers for generic APIs. This paper studies the automated fuzz driver synthesis problem for Rust libraries with generic APIs. The problem is essential because Rust emphasizes security, and generic APIs are widely employed in Rust crates. Each generic API can have numerous monomorphic versions as long as the type constraints are satisfied. The critical challenge to this problem lies in prioritizing these monomorphic versions and providing valid inputs for them. To address the problem, we extend existing API-dependency graphs to support generic APIs. By solving such dependencies and type constraints, we can generate a collection of candidate monomorphic APIs. Further, we apply a similarity-based filter to prune redundant versions, particularly if multiple monomorphic APIs adopt the identical trait implementation. Experimental results with 29 popular open-source libraries show that our approach can achieve promising generic API coverage with a low rate of invalid fuzz drivers. Besides, we find 23 bugs previously unknown in these libraries, with 18 bugs related to generic APIs.

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

↑