cargo-fuzz

Automate cargo-fuzz fuzzing campaigns with libFuzzer and sanitizer instrumentation.

19.0k|5.6k|Updated Jul 9, 2024
One-click install
npx skills add https://github.com/elizaOS/eliza --skill cargo-fuzz-elizaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cargo-fuzz
Source: https://github.com/elizaOS/eliza/tree/main/packages/skills/skills/testing-handbook-skills/skills/cargo-fuzz
Command: npx skills add https://github.com/elizaOS/eliza --skill cargo-fuzz-elizaos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires libfuzzer-sys, arbitrary, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of finding bugs in Rust code by using fuzzing techniques, specifically designed for projects managed with Cargo.

Core Features & Use Cases

  • Fuzzing Rust Code: Integrates seamlessly with Cargo to fuzz your Rust projects.
  • Sanitizer Support: Automatically enables AddressSanitizer and other necessary flags.
  • Structure-Aware Fuzzing: Supports the arbitrary crate for more intelligent fuzzing.
  • Use Case: You've written a new parsing library in Rust and want to ensure it's robust against malformed inputs. Use this Skill to automatically generate diverse inputs and discover potential crashes or vulnerabilities.

Quick Start

Run cargo-fuzz to fuzz the target '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 fuzz test my Rust code to find memory bugs?

Fuzz testing Rust code is automated by setting up cargo-fuzz harnesses that integrate with libFuzzer and enable sanitizer instrumentation to detect memory errors and crashes.

How do I set up a fuzzing harness for a Cargo-based Rust project?

Setting up a fuzzing harness for a Cargo project involves using cargo-fuzz to generate diverse inputs, initialize the fuzzing campaign, and run the target to discover potential vulnerabilities.

Does cargo-fuzz support structure-aware fuzzing with the arbitrary crate?

Structure-aware fuzzing is supported in cargo-fuzz by utilizing the arbitrary crate, allowing the generation of intelligent and structured inputs tailored to your Rust application's data types.

Can I use AddressSanitizer with Rust fuzz testing?

AddressSanitizer is automatically enabled by cargo-fuzz along with other necessary flags, allowing you to detect memory corruption and safety violations during Rust fuzz testing campaigns.

How do I analyze code coverage reports from a Rust fuzzing campaign?

Analyzing coverage reports from a Rust fuzzing campaign is facilitated by cargo-fuzz, which helps you review code paths exercised by generated inputs and identify untested branches.

Why do I need libfuzzer-sys and arbitrary dependencies for Rust fuzzing?

The libfuzzer-sys dependency provides the core libFuzzer engine integration, while the arbitrary dependency enables structure-aware fuzzing, both required to automate bug discovery in Rust projects.