37 releases

0.12.0 Feb 20, 2024
0.11.2 Feb 13, 2023
0.11.1 Oct 25, 2022
0.11.0 Sep 27, 2021
0.4.0 Mar 30, 2017

#67 in Testing

Download history 11755/week @ 2024-07-20 16658/week @ 2024-07-27 11791/week @ 2024-08-03 12903/week @ 2024-08-10 11931/week @ 2024-08-17 10490/week @ 2024-08-24 10873/week @ 2024-08-31 10303/week @ 2024-09-07 10278/week @ 2024-09-14 10004/week @ 2024-09-21 9284/week @ 2024-09-28 12212/week @ 2024-10-05 13881/week @ 2024-10-12 12612/week @ 2024-10-19 11664/week @ 2024-10-26 10890/week @ 2024-11-02

51,548 downloads per month
Used in text_manipulation_rs

MIT/Apache

64KB
1.5K SLoC

cargo fuzz

A cargo subcommand for fuzzing with libFuzzer! Easy to use!

Installation

$ cargo install cargo-fuzz

Note: libFuzzer needs LLVM sanitizer support, so this only works on x86-64 Linux, x86-64 macOS and Apple-Silicon (aarch64) macOS for now. You'll also need a C++ compiler with C++11 support.

If you have an old version of cargo fuzz, you can upgrade with this command:

$ cargo install -f cargo-fuzz

Usage

cargo fuzz init

Initialize a cargo fuzz project for your crate!

If your crate uses cargo workspaces, add fuzz directory to workspace.members in root Cargo.toml

fuzz directory can be either a part of an existing workspace (default) or use an independent workspace. If latter is desired, you can use cargo fuzz init --fuzzing-workspace=true.

cargo fuzz add <target>

Create a new fuzzing target!

cargo fuzz run <target>

Run a fuzzing target and find bugs!

cargo fuzz fmt <target> <input>

Print the std::fmt::Debug output for a test case. Useful when your fuzz target takes an Arbitrary input!

cargo fuzz tmin <target> <input>

Found a failing input? Minify it to the smallest input that causes that failure for easier debugging!

cargo fuzz cmin <target>

Minify your corpus of input files!

cargo fuzz coverage <target>

Generate coverage information on the fuzzed program!

Documentation

Documentation can be found in the Rust Fuzz Book.

You can also always find the full command-line options that are available with --help:

$ cargo fuzz --help

Trophy case

The trophy case has a list of bugs found by cargo fuzz (and others). Did cargo fuzz and libFuzzer find a bug for you? Add it to the trophy case!

License

cargo-fuzz is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Dependencies

~4–13MB
~172K SLoC