24 releases (7 breaking)

0.8.0 Apr 18, 2020
0.6.0 Feb 15, 2020
0.5.2 Nov 13, 2019
0.4.4 Jul 27, 2019
0.1.1 Feb 1, 2016

#118 in Testing

Download history 356/week @ 2020-09-23 459/week @ 2020-09-30 577/week @ 2020-10-07 614/week @ 2020-10-14 561/week @ 2020-10-21 549/week @ 2020-10-28 400/week @ 2020-11-04 507/week @ 2020-11-11 478/week @ 2020-11-18 614/week @ 2020-11-25 631/week @ 2020-12-02 539/week @ 2020-12-09 393/week @ 2020-12-16 241/week @ 2020-12-23 360/week @ 2020-12-30 490/week @ 2021-01-06

1,840 downloads per month
Used in less than 7 crates

Apache-2.0

2.5MB
53K SLoC

C 45K SLoC // 0.1% comments C++ 4K SLoC // 0.2% comments Shell 1.5K SLoC // 0.1% comments Python 1.5K SLoC // 0.3% comments Rust 503 SLoC // 0.2% comments BASH 247 SLoC // 0.3% comments SQL 40 SLoC JavaScript 1 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 overide 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_staic feature on afl.rs:
    [dependencies]
    afl = { version = "0.6.0", features = ["reset_lazy_static"] }
    

Dependencies