39 releases

0.12.10 Oct 26, 2022
0.12.8 Sep 2, 2022
0.12.4 May 9, 2022
0.12.2 Mar 3, 2022
0.1.1 Feb 1, 2016

#139 in Testing

Download history 1298/week @ 2022-08-10 1547/week @ 2022-08-17 2078/week @ 2022-08-24 1952/week @ 2022-08-31 1315/week @ 2022-09-07 1339/week @ 2022-09-14 1393/week @ 2022-09-21 1138/week @ 2022-09-28 1248/week @ 2022-10-05 1235/week @ 2022-10-12 1001/week @ 2022-10-19 1625/week @ 2022-10-26 1444/week @ 2022-11-02 1285/week @ 2022-11-09 1215/week @ 2022-11-16 895/week @ 2022-11-23

5,114 downloads per month
Used in fewer than 7 crates

Apache-2.0

4.5MB
114K SLoC

C 92K SLoC // 0.1% comments C++ 14K SLoC // 0.1% comments Python 3.5K SLoC // 0.2% comments Shell 3K SLoC // 0.1% comments Rust 751 SLoC // 0.1% comments JavaScript 544 SLoC // 0.2% comments TypeScript 314 SLoC // 0.4% comments BASH 256 SLoC // 0.3% comments CodeQL 45 SLoC // 0.1% comments Java 43 SLoC // 0.4% comments SQL 3 SLoC

afl.rs logo
afl.rs

Fuzzing Rust code with AFLplusplus

What is it?

Fuzz testing is a software testing technique used to find security and stability issues by providing pseudo-random data as input to the software. AFLplusplus is a popular, effective, and modern fuzz testing tool based on AFL. This library, afl.rs, allows one to run AFLplusplus on code written in the Rust programming language.

Documentation

Documentation can be found in the Rust Fuzz Book.

What does it look like?

Screen recording of afl

Screen recording of AFL running on Rust code.

lazy_static variables

lazy_static variables present problems for AFL's persistent mode, which afl.rs uses. Such variables can cause AFL to give incorrectly low stability reports, or fail to report timeouts, for example.

To address such problems, rust-fuzz provides a "resettable" version of lazy_static. To use it, make the following two changes to your target's Cargo.toml file.

  1. Add a [patch.crates-io] section and override the lazy_static dependency with the rust-fuzz version:
    [patch.crates-io]
    lazy_static = { git = "https://github.com/rust-fuzz/resettable-lazy-static.rs" }
    
    
  2. Enable the reset_lazy_static feature on afl.rs:
    [dependencies]
    afl = { version = "*", features = ["reset_lazy_static"] }
    

Dependencies