RPG: Rust Library Fuzzing with Pool-based Fuzz Target Generation and Generic Support
Open Access
- 12 April 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 1-13
Abstract
Rust libraries are ubiquitous in Rust-based software development. Guaranteeing their correctness and reliability requires thorough analysis and testing. Fuzzing is a popular bug-finding solution, yet it requires writing fuzz targets for libraries. Recently, some automatic fuzz target generation methods have been proposed. However, two challenges remain: (1) how to generate diverse API sequences that prioritize unsafe code and interactions to reveal bugs in Rust libraries; (2) how to provide support for the generic APIs and verify both syntactic and semantic validity of the fuzz targets to enable more comprehensive testing of Rust libraries. In this paper, we propose RPG, an automatic fuzz target synthesis technique to support Rust library fuzzing. RPG uses a pool-based search to generate diverse and unsafe API sequences, and synthesizes fuzz targets with generic support and validity check. The experimental results demonstrate that RPG enhances both the quality of the generated fuzz targets and the bug-finding ability through pool-based generation and generic support, substantially outperforming the state-of-the-art. Moreover, RPG has discovered 25 previously unknown bugs from 50 well-known Rust libraries available on Crates.io.Keywords
Funding Information
- National Natural Science Foundation of China (62372304, 61972260, 62302375, 62192734)
This publication has 45 references indexed in Scilit:
- Rust Library FuzzingIEEE Software, 2022
- An Empirical Study of Yanked Releases in the Rust Package RegistryIEEE Transactions on Software Engineering, 2022
- RULF: Rust Library Fuzzing via API Dependency Graph Traversal2021
- MemLock2020
- Securing unsafe rust programs with XRust2020
- FuzzingCommunications of the ACM, 2020
- FUDGE: fuzz driver generation at scale2019
- Automated Test Case Generation as a Many-Objective Optimisation Problem with Dynamic Selection of the TargetsIEEE Transactions on Software Engineering, 2017
- Lightweight, flexible object-oriented generics2015
- Z3: An Efficient SMT Solver2008