https://github.com/rust-fuzz/cargo-fuzz
Command line helpers for fuzzing
https://github.com/rust-fuzz/cargo-fuzz
cargo fuzz-testing fuzzing rust
Last synced: 6 days ago
JSON representation
Command line helpers for fuzzing
- Host: GitHub
- URL: https://github.com/rust-fuzz/cargo-fuzz
- Owner: rust-fuzz
- License: apache-2.0
- Created: 2017-02-21T04:04:56.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2025-03-11T22:55:49.000Z (about 1 month ago)
- Last Synced: 2025-04-01T21:59:36.719Z (13 days ago)
- Topics: cargo, fuzz-testing, fuzzing, rust
- Language: Rust
- Homepage: https://rust-fuzz.github.io/book/cargo-fuzz.html
- Size: 530 KB
- Stars: 1,599
- Watchers: 24
- Forks: 116
- Open Issues: 107
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-rust-security-guide - cargo-fuzz
README
cargo fuzz
A
cargo
subcommand for fuzzing withlibFuzzer
! Easy to use!## Installation
```sh
$ cargo install cargo-fuzz
```Note: `libFuzzer` needs LLVM sanitizer support, so this only works on x86-64 and Aarch64,
and only on Unix-like operating systems (not Windows). You'll also need a C++ compiler with C++11 support.## 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 `
Create a new fuzzing target!
### `cargo fuzz run `
Run a fuzzing target and find bugs!
### `cargo fuzz fmt `
Print the `std::fmt::Debug` output for a test case. Useful when your fuzz target
takes an `Arbitrary` input!### `cargo fuzz tmin `
Found a failing input? Minify it to the smallest input that causes that failure
for easier debugging!### `cargo fuzz cmin `
Minify your corpus of input files!
### `cargo fuzz coverage `
Generate coverage information on the fuzzed program!
## Documentation
Documentation can be found in the [Rust Fuzz
Book](https://rust-fuzz.github.io/book/cargo-fuzz.html).You can also always find the full command-line options that are available with
`--help`:```sh
$ cargo fuzz --help
```## Trophy case
[The trophy case](https://github.com/rust-fuzz/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](./LICENSE-APACHE) and [LICENSE-MIT](./LICENSE-MIT) for
details.