cargo-fuzz

Run libFuzzer fuzz tests for Cargo-based Rust code.

Updated May 2, 2026
One-click install
npx skills add https://github.com/ayehiaa/my-travel-assistant --skill cargo-fuzz-ayehiaa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cargo-fuzz
Source: https://github.com/ayehiaa/my-travel-assistant/tree/main/.agents/skills/cargo-fuzz
Command: npx skills add https://github.com/ayehiaa/my-travel-assistant --skill cargo-fuzz-ayehiaa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

cargo-fuzz helps you find crashes and memory-safety issues in Rust code faster by running structure-aware fuzz tests with automated compilation and sanitizer support.

Core Features & Use Cases

  • Cargo-integrated Rust fuzzing: uses Cargo workflows and a convenient subcommand to build and run fuzz targets reliably.
  • libFuzzer backend + sanitizer support: runs fuzzing with libFuzzer and supports AddressSanitizer by default, enabling effective bug discovery.
  • Harness and corpus guidance for practical targets: helps you design #![no_main] harnesses and organize fuzz/, fuzz_targets/, fuzz/corpus/, and fuzz/artifacts/ for repeated campaigns.
  • Use Case: When you have a Rust library that parses untrusted inputs (for example, a media or document parser), you can fuzz the parsing entry points to uncover edge-case panics or memory bugs before release.

Quick Start

Initialize fuzzing and run your first target by executing 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 fuzz testing for a Rust Cargo project?

Fuzzing Rust code with libFuzzer requires a nightly Rust toolchain and a `#![no_main]` harness. This Skill automates the setup, letting you initialize and run fuzz targets directly through a Cargo subcommand workflow.

What is the best way to find memory safety bugs in Rust parsers?

Fuzzing Rust parsers with libFuzzer and AddressSanitizer effectively uncovers memory safety bugs and edge-case panics. This Skill configures sanitizer support automatically to detect crashes from malformed or untrusted input data.

Does Rust fuzzing with libFuzzer require a nightly toolchain?

Yes, Rust fuzzing with libFuzzer requires a nightly toolchain to enable the necessary unstable compiler flags. This Skill uses a nightly-based Rust toolchain workflow to compile and run the fuzz harnesses reliably.

Can I run fuzz tests without AddressSanitizer for safe Rust code?

You can disable AddressSanitizer when fuzzing safe Rust code to prioritize execution speed. This Skill provides optional sanitizer configuration, allowing you to set sanitizer support to none for faster fuzzing cycles.

How do I organize corpus and artifacts when fuzzing Rust libraries?

Organizing corpus and artifacts involves structuring directories like `fuzz/corpus/` for inputs and `fuzz/artifacts/` for crash data. This Skill helps you design `#![no_main]` harnesses and manage these folders for repeated fuzzing campaigns.