cargo-fuzz

Automate fuzz testing for Rust projects with cargo-fuzz and libFuzzer.

6.5k|561|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/trailofbits/skills --skill cargo-fuzz-trailofbits
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cargo-fuzz
Source: https://github.com/trailofbits/skills/tree/main/plugins/testing-handbook-skills/skills/cargo-fuzz
Command: npx skills add https://github.com/trailofbits/skills --skill cargo-fuzz-trailofbits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fuzzing Rust projects with Cargo used to be manual and slow; cargo-fuzz automates this workflow by integrating libFuzzer to continuously test code paths with randomized inputs.

Core Features & Use Cases

  • Integrated harness generation and management for Rust crates.
  • Supports sanitizer integration and coverage-guided fuzz campaigns.
  • Suitable for library crates, binary crates, and CI fuzz workflows.

Quick Start

Initialize fuzzing by creating a fuzzing project with cargo fuzz and then run a target, e.g., cargo fuzz init and cargo +nightly fuzz run fuzz_target_1.

Frequently Asked Questions about cargo-fuzz

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

FAQPage Schema
How do I set up fuzzing for a Rust project with Cargo?▼

Coverage-guided fuzzing works for Rust by integrating libFuzzer with cargo-fuzz to continuously test code paths with randomized inputs. It enables iterative fuzz campaigns with coverage feedback to discover edge cases.

Can I use sanitizers when fuzz testing Rust code?▼

Sanitizers are supported when fuzz testing Rust code through cargo-fuzz integration. This allows you to combine sanitizer integration with coverage-guided fuzz campaigns to detect memory and undefined behavior issues.

Does cargo-fuzz work with Rust binary crates or only library crates?▼

cargo-fuzz works with both Rust library crates and binary crates. This enables flexible harness generation and management for fuzzing various Cargo-based Rust project structures and CI fuzz workflows.

What is the best way to automate fuzz testing for Rust libraries?▼

The best way to automate fuzz testing for Rust libraries is using cargo-fuzz to integrate libFuzzer. It automates the manual workflow by handling harness generation, corpus management, and iterative fuzz campaigns with coverage feedback.

Do I need the nightly Rust toolchain to run a fuzz target?▼

You need the nightly Rust toolchain to run a fuzz target with cargo-fuzz, as invoked via cargo +nightly fuzz run. This requirement supports the coverage-guided fuzzing and sanitizer integration features.