cargo-fuzz

Fuzzes Rust crates with Cargo and libFuzzer to discover crashes and undefined behavior.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/Avi977/ace-claude-toolkit --skill cargo-fuzz-avi977
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cargo-fuzz
Source: https://github.com/Avi977/ace-claude-toolkit/tree/main/skills/testing-handbook-skills/cargo-fuzz
Command: npx skills add https://github.com/Avi977/ace-claude-toolkit --skill cargo-fuzz-avi977

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fuzzing Rust crates with Cargo and libFuzzer helps automatically discover crashes, undefined behavior, and security defects by generating diverse inputs and exercising library code.

Core Features & Use Cases

  • Automates fuzz testing for Rust crates using Cargo and libFuzzer.
  • Provides harness templates, structure-aware fuzzing via the arbitrary crate, dictionaries, seed corpora, and coverage reporting.
  • Supports sanitizers like AddressSanitizer and workflow optimizations for rapid iteration in fuzz campaigns.

Quick Start

Run cargo fuzz init and cargo fuzz run to start fuzzing your Rust project.

Frequently Asked Questions about cargo-fuzz

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fuzz a Rust crate to find crashes and undefined behavior?

To fuzz a Rust crate, you can use Cargo with libFuzzer to automatically generate diverse inputs and exercise library code to discover crashes and undefined behavior. This approach automates fuzz testing by running `cargo fuzz init` and `cargo fuzz run`.

What is structure-aware fuzzing in Rust and how do I use it?

Structure-aware fuzzing in Rust generates valid inputs by leveraging the arbitrary crate. It is used in fuzzing campaigns alongside harnesses and dictionaries to improve the effectiveness of fuzz testing for Rust library crates.

Do I need a nightly Rust toolchain to use cargo-fuzz with libFuzzer?

Yes, fuzzing Rust crates with Cargo and libFuzzer requires the nightly Rust toolchain. You also need cargo-fuzz and libFuzzer installed to run fuzzing campaigns and apply sanitizers like AddressSanitizer.

How do I set up a fuzzing harness for a Rust library?

You can set up a fuzzing harness for a Rust library by using provided harness templates and running `cargo fuzz init`. This creates a fuzz target that you can customize with seed corpora and dictionaries for your fuzzing campaign.

Can I use AddressSanitizer with cargo-fuzz to detect memory defects?

Yes, you can use AddressSanitizer with cargo-fuzz to detect memory defects. The tool supports sanitizers like AddressSanitizer to help identify undefined behavior and security defects during your fuzzing campaigns.