[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75C22YM8EEPN0SMEYZ8RS22":3,"skill-same:01M75C22YM8EEPN0SMEYZ8RS22":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M75C22YM8EEPN0SMEYZ8RS22","cargo-fuzz",null,"cargo-fuzz is the de facto fuzzing tool for Rust projects using Cargo. Use for fuzzing Rust code with libFuzzer backend.","agisota\u002Fold-one","agisota","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121413592?v=4","01M75B4BRNT67EC1NDRT8QZEP2","01M75B4BS7QR9VP580MSCPTS3X",3,"MIT","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fcargo-fuzz\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: cargo-fuzz\ntype: fuzzer\ndescription: >\n  cargo-fuzz is the de facto fuzzing tool for Rust projects using Cargo.\n  Use for fuzzing Rust code with libFuzzer backend.\n---\n\n# cargo-fuzz\n\ncargo-fuzz is the de facto choice for fuzzing Rust projects when using Cargo. It uses libFuzzer as the backend and provides a convenient Cargo subcommand that automatically enables relevant compilation flags for your Rust project, including support for sanitizers like AddressSanitizer.\n\n## When to Use\n\ncargo-fuzz is currently the primary and most mature fuzzing solution for Rust projects using Cargo.\n\n| Fuzzer | Best For | Complexity |\n|--------|----------|------------|\n| cargo-fuzz | Cargo-based Rust projects, quick setup | Low |\n| AFL++ | Multi-core fuzzing, non-Cargo projects | Medium |\n| LibAFL | Custom fuzzers, research, advanced use cases | High |\n\n**Choose cargo-fuzz when:**\n- Your project uses Cargo (required)\n- You want simple, quick setup with minimal configuration\n- You need integrated sanitizer support\n- You're fuzzing Rust code with or without unsafe blocks\n\n## Quick Start\n\n```rust\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\n\nfn harness(data: &[u8]) {\n    your_project::check_buf(data);\n}\n\nfuzz_target!(|data: &[u8]| {\n    harness(data);\n});\n```\n\nInitialize and run:\n```bash\ncargo fuzz init\n# Edit fuzz\u002Ffuzz_targets\u002Ffuzz_target_1.rs with your harness\ncargo +nightly fuzz run fuzz_target_1\n```\n\n## Installation\n\ncargo-fuzz requires the nightly Rust toolchain because it uses features only available in nightly.\n\n### Prerequisites\n\n- Rust and Cargo installed via [rustup](https:\u002F\u002Frustup.rs\u002F)\n- Nightly toolchain\n\n### Linux\u002FmacOS\n\n```bash\n# Install nightly toolchain\nrustup install nightly\n\n# Install cargo-fuzz\ncargo install cargo-fuzz\n```\n\n### Verification\n\n```bash\ncargo +nightly --version\ncargo fuzz --version\n```\n\n## Writing a Harness\n\n### Project Structure\n\ncargo-fuzz works best when your code is structured as a library crate. If you have a binary project, split your `main.rs` into:\n\n```text\nsrc\u002Fmain.rs  # Entry point (main function)\nsrc\u002Flib.rs   # Code to fuzz (public functions)\nCargo.toml\n```\n\nInitialize fuzzing:\n```bash\ncargo fuzz init\n```\n\nThis creates:\n```text\nfuzz\u002F\n├── Cargo.toml\n└── fuzz_targets\u002F\n    └── fuzz_target_1.rs\n```\n\n### Harness Structure\n\n```rust\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\n\nfn harness(data: &[u8]) {\n    \u002F\u002F 1. Validate input size if needed\n    if data.is_empty() {\n        return;\n    }\n\n    \u002F\u002F 2. Call target function with fuzz data\n    your_project::target_function(data);\n}\n\nfuzz_target!(|data: &[u8]| {\n    harness(data);\n});\n```\n\n### Harness Rules\n\n| Do | Don't |\n|----|-------|\n| Structure code as library crate | Keep everything in main.rs |\n| Use `fuzz_target!` macro | Write custom main function |\n| Handle `Result::Err` gracefully | Panic on expected errors |\n| Keep harness deterministic | Use random number generators |\n\n> **See Also:** For detailed harness writing techniques and structure-aware fuzzing with the\n> `arbitrary` crate, see the **fuzz-harness-writing** technique skill.\n\n## Structure-Aware Fuzzing\n\ncargo-fuzz integrates with the [arbitrary](https:\u002F\u002Fgithub.com\u002Frust-fuzz\u002Farbitrary) crate for structure-aware fuzzing:\n\n```rust\n\u002F\u002F In your library crate\nuse arbitrary::Arbitrary;\n\n#[derive(Debug, Arbitrary)]\npub struct Name {\n    data: String\n}\n```\n\n```rust\n\u002F\u002F In your fuzz target\n#![no_main]\nuse libfuzzer_sys::fuzz_target;\n\nfuzz_target!(|data: your_project::Name| {\n    data.check_buf();\n});\n```\n\nAdd to your library's `Cargo.toml`:\n```toml\n[dependencies]\narbitrary = { version = \"1\", features = [\"derive\"] }\n```\n\n## Running Campaigns\n\n### Basic Run\n\n```bash\ncargo +nightly fuzz run fuzz_target_1\n```\n\n### Without Sanitizers (Safe Rust)\n\nIf your project doesn't use unsafe Rust, disable sanitizers for 2x performance boost:\n\n```bash\ncargo +nightly fuzz run --sanitizer none fuzz_target_1\n```\n\nCheck if your project uses unsafe code:\n```bash\ncargo install cargo-geiger\ncargo geiger\n```\n\n### Re-executing Test Cases\n\n```bash\n# Run a specific test case (e.g., a crash)\ncargo +nightly fuzz run fuzz_target_1 fuzz\u002Fartifacts\u002Ffuzz_target_1\u002Fcrash-\u003Chash>\n\n# Run all corpus entries without fuzzing\ncargo +nightly fuzz run fuzz_target_1 fuzz\u002Fcorpus\u002Ffuzz_target_1 -- -runs=0\n```\n\n### Using Dictionaries\n\n```bash\ncargo +nightly fuzz run fuzz_target_1 -- -dict=.\u002Fdict.dict\n```\n\n### Interpreting Output\n\n| Output | Meaning |\n|--------|---------|\n| `NEW` | New coverage-increasing input discovered |\n| `pulse` | Periodic status update |\n| `INITED` | Fuzzer initialized successfully |\n| Crash with stack trace | Bug found, saved to `fuzz\u002Fartifacts\u002F` |\n\nCorpus location: `fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F`\nCrashes location: `fuzz\u002Fartifacts\u002Ffuzz_target_1\u002F`\n\n## Sanitizer Integration\n\n### AddressSanitizer (ASan)\n\nASan is enabled by default and detects memory errors:\n\n```bash\ncargo +nightly fuzz run fuzz_target_1\n```\n\n### Disabling Sanitizers\n\nFor pure safe Rust (no unsafe blocks in your code or dependencies):\n\n```bash\ncargo +nightly fuzz run --sanitizer none fuzz_target_1\n```\n\n**Performance impact:** ASan adds ~2x overhead. Disable for safe Rust to improve fuzzing speed.\n\n### Checking for Unsafe Code\n\n```bash\ncargo install cargo-geiger\ncargo geiger\n```\n\n> **See Also:** For detailed sanitizer configuration, flags, and troubleshooting,\n> see the **address-sanitizer** technique skill.\n\n## Coverage Analysis\n\ncargo-fuzz integrates with Rust's coverage tools to analyze fuzzing effectiveness.\n\n### Prerequisites\n\n```bash\nrustup toolchain install nightly --component llvm-tools-preview\ncargo install cargo-binutils\ncargo install rustfilt\n```\n\n### Generating Coverage Reports\n\n```bash\n# Generate coverage data from corpus\ncargo +nightly fuzz coverage fuzz_target_1\n```\n\nCreate coverage generation script:\n\n```bash\ncat \u003C\u003C'EOF' > .\u002Fgenerate_html\n#!\u002Fbin\u002Fsh\nif [ $# -lt 1 ]; then\n    echo \"Error: Name of fuzz target is required.\"\n    echo \"Usage: $0 fuzz_target [sources...]\"\n    exit 1\nfi\nFUZZ_TARGET=\"$1\"\nshift\nSRC_FILTER=\"$@\"\nTARGET=$(rustc -vV | sed -n 's|host: ||p')\ncargo +nightly cov -- show -Xdemangler=rustfilt \\\n  \"target\u002F$TARGET\u002Fcoverage\u002F$TARGET\u002Frelease\u002F$FUZZ_TARGET\" \\\n  -instr-profile=\"fuzz\u002Fcoverage\u002F$FUZZ_TARGET\u002Fcoverage.profdata\"  \\\n  -show-line-counts-or-regions -show-instantiations  \\\n  -format=html -o fuzz_html\u002F $SRC_FILTER\nEOF\nchmod +x .\u002Fgenerate_html\n```\n\nGenerate HTML report:\n```bash\n.\u002Fgenerate_html fuzz_target_1 src\u002Flib.rs\n```\n\nHTML report saved to: `fuzz_html\u002F`\n\n> **See Also:** For detailed coverage analysis techniques and systematic coverage improvement,\n> see the **coverage-analysis** technique skill.\n\n## Advanced Usage\n\n### Tips and Tricks\n\n| Tip | Why It Helps |\n|-----|--------------|\n| Start with a seed corpus | Dramatically speeds up initial coverage discovery |\n| Use `--sanitizer none` for safe Rust | 2x performance improvement |\n| Check coverage regularly | Identifies gaps in harness or seed corpus |\n| Use dictionaries for parsers | Helps overcome magic value checks |\n| Structure code as library | Required for cargo-fuzz integration |\n\n### libFuzzer Options\n\nPass options to libFuzzer after `--`:\n\n```bash\n# See all options\ncargo +nightly fuzz run fuzz_target_1 -- -help=1\n\n# Set timeout per run\ncargo +nightly fuzz run fuzz_target_1 -- -timeout=10\n\n# Use dictionary\ncargo +nightly fuzz run fuzz_target_1 -- -dict=dict.dict\n\n# Limit maximum input size\ncargo +nightly fuzz run fuzz_target_1 -- -max_len=1024\n```\n\n### Multi-Core Fuzzing\n\n```bash\n# Experimental forking support (not recommended)\ncargo +nightly fuzz run --jobs 1 fuzz_target_1\n```\n\nNote: The multi-core fuzzing feature is experimental and not recommended. For parallel fuzzing, consider running multiple instances manually or using AFL++.\n\n## Real-World Examples\n\n### Example: ogg Crate\n\nThe [ogg crate](https:\u002F\u002Fgithub.com\u002FRustAudio\u002Fogg) parses Ogg media container files. Parsers are excellent fuzzing targets because they handle untrusted data.\n\n```bash\n# Clone and initialize\ngit clone https:\u002F\u002Fgithub.com\u002FRustAudio\u002Fogg.git\ncd ogg\u002F\ncargo fuzz init\n```\n\nHarness at `fuzz\u002Ffuzz_targets\u002Ffuzz_target_1.rs`:\n\n```rust\n#![no_main]\n\nuse ogg::{PacketReader, PacketWriter};\nuse ogg::writing::PacketWriteEndInfo;\nuse std::io::Cursor;\nuse libfuzzer_sys::fuzz_target;\n\nfn harness(data: &[u8]) {\n    let mut pck_rdr = PacketReader::new(Cursor::new(data.to_vec()));\n    pck_rdr.delete_unread_packets();\n\n    let output = Vec::new();\n    let mut pck_wtr = PacketWriter::new(Cursor::new(output));\n\n    if let Ok(_) = pck_rdr.read_packet() {\n        if let Ok(r) = pck_rdr.read_packet() {\n            match r {\n                Some(pck) => {\n                    let inf = if pck.last_in_stream() {\n                        PacketWriteEndInfo::EndStream\n                    } else if pck.last_in_page() {\n                        PacketWriteEndInfo::EndPage\n                    } else {\n                        PacketWriteEndInfo::NormalPacket\n                    };\n                    let stream_serial = pck.stream_serial();\n                    let absgp_page = pck.absgp_page();\n                    let _ = pck_wtr.write_packet(\n                        pck.data, stream_serial, inf, absgp_page\n                    );\n                }\n                None => return,\n            }\n        }\n    }\n}\n\nfuzz_target!(|data: &[u8]| {\n    harness(data);\n});\n```\n\nSeed the corpus:\n```bash\nmkdir fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F\ncurl -o fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F320x240.ogg \\\n  https:\u002F\u002Fcommons.wikimedia.org\u002Fwiki\u002FFile:320x240.ogg\n```\n\nRun:\n```bash\ncargo +nightly fuzz run fuzz_target_1\n```\n\nAnalyze coverage:\n```bash\ncargo +nightly fuzz coverage fuzz_target_1\n.\u002Fgenerate_html fuzz_target_1 src\u002Flib.rs\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| \"requires nightly\" error | Using stable toolchain | Use `cargo +nightly fuzz` |\n| Slow fuzzing performance | ASan enabled for safe Rust | Add `--sanitizer none` flag |\n| \"cannot find binary\" | No library crate | Move code from `main.rs` to `lib.rs` |\n| Sanitizer compilation issues | Wrong nightly version | Try different nightly: `rustup install nightly-2024-01-01` |\n| Low coverage | Missing seed corpus | Add sample inputs to `fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F` |\n| Magic value not found | No dictionary | Create dictionary file with magic values |\n\n## Related Skills\n\n### Technique Skills\n\n| Skill | Use Case |\n|-------|----------|\n| **fuzz-harness-writing** | Structure-aware fuzzing with `arbitrary` crate |\n| **address-sanitizer** | Understanding ASan output and configuration |\n| **coverage-analysis** | Measuring and improving fuzzing effectiveness |\n| **fuzzing-corpus** | Building and managing seed corpora |\n| **fuzzing-dictionaries** | Creating dictionaries for format-aware fuzzing |\n\n### Related Fuzzers\n\n| Skill | When to Consider |\n|-------|------------------|\n| **libfuzzer** | Fuzzing C\u002FC++ code with similar workflow |\n| **aflpp** | Multi-core fuzzing or non-Cargo Rust projects |\n| **libafl** | Advanced fuzzing research or custom fuzzer development |\n\n## Resources\n\n**[Rust Fuzz Book - cargo-fuzz](https:\u002F\u002Frust-fuzz.github.io\u002Fbook\u002Fcargo-fuzz.html)**\nOfficial documentation for cargo-fuzz covering installation, usage, and advanced features.\n\n**[arbitrary crate documentation](https:\u002F\u002Fdocs.rs\u002Farbitrary\u002Flatest\u002Farbitrary\u002F)**\nGuide to structure-aware fuzzing with automatic derivation for Rust types.\n\n**[cargo-fuzz GitHub Repository](https:\u002F\u002Fgithub.com\u002Frust-fuzz\u002Fcargo-fuzz)**\nSource code, issue tracker, and examples for cargo-fuzz.\n","# cargo-fuzz\n\ncargo-fuzz is the de facto choice for fuzzing Rust projects when using Cargo. It uses libFuzzer as the backend and provides a convenient Cargo subcommand that automatically enables relevant compilation flags for your Rust project, including support for sanitizers like AddressSanitizer.\n\n## When to Use\n\ncargo-fuzz is currently the primary and most mature fuzzing solution for Rust projects using Cargo.\n\n| Fuzzer | Best For | Complexity |\n|--------|----------|------------|\n| cargo-fuzz | Cargo-based Rust projects, quick setup | Low |\n| AFL++ | Multi-core fuzzing, non-Cargo projects | Medium |\n| LibAFL | Custom fuzzers, research, advanced use cases | High |\n\n**Choose cargo-fuzz when:**\n- Your project uses Cargo (required)\n- You want simple, quick setup with minimal configuration\n- You need integrated sanitizer support\n- You're fuzzing Rust code with or without unsafe blocks\n\n## Quick Start\n\n```rust\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\n\nfn harness(data: &[u8]) {\n    your_project::check_buf(data);\n}\n\nfuzz_target!(|data: &[u8]| {\n    harness(data);\n});\n```\n\nInitialize and run:\n```bash\ncargo fuzz init\n# Edit fuzz\u002Ffuzz_targets\u002Ffuzz_target_1.rs with your harness\ncargo +nightly fuzz run fuzz_target_1\n```\n\n## Installation\n\ncargo-fuzz requires the nightly Rust toolchain because it uses features only available in nightly.\n\n### Prerequisites\n\n- Rust and Cargo installed via [rustup](https:\u002F\u002Frustup.rs\u002F)\n- Nightly toolchain\n\n### Linux\u002FmacOS\n\n```bash\n# Install nightly toolchain\nrustup install nightly\n\n# Install cargo-fuzz\ncargo install cargo-fuzz\n```\n\n### Verification\n\n```bash\ncargo +nightly --version\ncargo fuzz --version\n```\n\n## Writing a Harness\n\n### Project Structure\n\ncargo-fuzz works best when your code is structured as a library crate. If you have a binary project, split your `main.rs` into:\n\n```text\nsrc\u002Fmain.rs  # Entry point (main function)\nsrc\u002Flib.rs   # Code to fuzz (public functions)\nCargo.toml\n```\n\nInitialize fuzzing:\n```bash\ncargo fuzz init\n```\n\nThis creates:\n```text\nfuzz\u002F\n├── Cargo.toml\n└── fuzz_targets\u002F\n    └── fuzz_target_1.rs\n```\n\n### Harness Structure\n\n```rust\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\n\nfn harness(data: &[u8]) {\n    \u002F\u002F 1. Validate input size if needed\n    if data.is_empty() {\n        return;\n    }\n\n    \u002F\u002F 2. Call target function with fuzz data\n    your_project::target_function(data);\n}\n\nfuzz_target!(|data: &[u8]| {\n    harness(data);\n});\n```\n\n### Harness Rules\n\n| Do | Don't |\n|----|-------|\n| Structure code as library crate | Keep everything in main.rs |\n| Use `fuzz_target!` macro | Write custom main function |\n| Handle `Result::Err` gracefully | Panic on expected errors |\n| Keep harness deterministic | Use random number generators |\n\n> **See Also:** For detailed harness writing techniques and structure-aware fuzzing with the\n> `arbitrary` crate, see the **fuzz-harness-writing** technique skill.\n\n## Structure-Aware Fuzzing\n\ncargo-fuzz integrates with the [arbitrary](https:\u002F\u002Fgithub.com\u002Frust-fuzz\u002Farbitrary) crate for structure-aware fuzzing:\n\n```rust\n\u002F\u002F In your library crate\nuse arbitrary::Arbitrary;\n\n#[derive(Debug, Arbitrary)]\npub struct Name {\n    data: String\n}\n```\n\n```rust\n\u002F\u002F In your fuzz target\n#![no_main]\nuse libfuzzer_sys::fuzz_target;\n\nfuzz_target!(|data: your_project::Name| {\n    data.check_buf();\n});\n```\n\nAdd to your library's `Cargo.toml`:\n```toml\n[dependencies]\narbitrary = { version = \"1\", features = [\"derive\"] }\n```\n\n## Running Campaigns\n\n### Basic Run\n\n```bash\ncargo +nightly fuzz run fuzz_target_1\n```\n\n### Without Sanitizers (Safe Rust)\n\nIf your project doesn't use unsafe Rust, disable sanitizers for 2x performance boost:\n\n```bash\ncargo +nightly fuzz run --sanitizer none fuzz_target_1\n```\n\nCheck if your project uses unsafe code:\n```bash\ncargo install cargo-geiger\ncargo geiger\n```\n\n### Re-executing Test Cases\n\n```bash\n# Run a specific test case (e.g., a crash)\ncargo +nightly fuzz run fuzz_target_1 fuzz\u002Fartifacts\u002Ffuzz_target_1\u002Fcrash-\u003Chash>\n\n# Run all corpus entries without fuzzing\ncargo +nightly fuzz run fuzz_target_1 fuzz\u002Fcorpus\u002Ffuzz_target_1 -- -runs=0\n```\n\n### Using Dictionaries\n\n```bash\ncargo +nightly fuzz run fuzz_target_1 -- -dict=.\u002Fdict.dict\n```\n\n### Interpreting Output\n\n| Output | Meaning |\n|--------|---------|\n| `NEW` | New coverage-increasing input discovered |\n| `pulse` | Periodic status update |\n| `INITED` | Fuzzer initialized successfully |\n| Crash with stack trace | Bug found, saved to `fuzz\u002Fartifacts\u002F` |\n\nCorpus location: `fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F`\nCrashes location: `fuzz\u002Fartifacts\u002Ffuzz_target_1\u002F`\n\n## Sanitizer Integration\n\n### AddressSanitizer (ASan)\n\nASan is enabled by default and detects memory errors:\n\n```bash\ncargo +nightly fuzz run fuzz_target_1\n```\n\n### Disabling Sanitizers\n\nFor pure safe Rust (no unsafe blocks in your code or dependencies):\n\n```bash\ncargo +nightly fuzz run --sanitizer none fuzz_target_1\n```\n\n**Performance impact:** ASan adds ~2x overhead. Disable for safe Rust to improve fuzzing speed.\n\n### Checking for Unsafe Code\n\n```bash\ncargo install cargo-geiger\ncargo geiger\n```\n\n> **See Also:** For detailed sanitizer configuration, flags, and troubleshooting,\n> see the **address-sanitizer** technique skill.\n\n## Coverage Analysis\n\ncargo-fuzz integrates with Rust's coverage tools to analyze fuzzing effectiveness.\n\n### Prerequisites\n\n```bash\nrustup toolchain install nightly --component llvm-tools-preview\ncargo install cargo-binutils\ncargo install rustfilt\n```\n\n### Generating Coverage Reports\n\n```bash\n# Generate coverage data from corpus\ncargo +nightly fuzz coverage fuzz_target_1\n```\n\nCreate coverage generation script:\n\n```bash\ncat \u003C\u003C'EOF' > .\u002Fgenerate_html\n#!\u002Fbin\u002Fsh\nif [ $# -lt 1 ]; then\n    echo \"Error: Name of fuzz target is required.\"\n    echo \"Usage: $0 fuzz_target [sources...]\"\n    exit 1\nfi\nFUZZ_TARGET=\"$1\"\nshift\nSRC_FILTER=\"$@\"\nTARGET=$(rustc -vV | sed -n 's|host: ||p')\ncargo +nightly cov -- show -Xdemangler=rustfilt \\\n  \"target\u002F$TARGET\u002Fcoverage\u002F$TARGET\u002Frelease\u002F$FUZZ_TARGET\" \\\n  -instr-profile=\"fuzz\u002Fcoverage\u002F$FUZZ_TARGET\u002Fcoverage.profdata\"  \\\n  -show-line-counts-or-regions -show-instantiations  \\\n  -format=html -o fuzz_html\u002F $SRC_FILTER\nEOF\nchmod +x .\u002Fgenerate_html\n```\n\nGenerate HTML report:\n```bash\n.\u002Fgenerate_html fuzz_target_1 src\u002Flib.rs\n```\n\nHTML report saved to: `fuzz_html\u002F`\n\n> **See Also:** For detailed coverage analysis techniques and systematic coverage improvement,\n> see the **coverage-analysis** technique skill.\n\n## Advanced Usage\n\n### Tips and Tricks\n\n| Tip | Why It Helps |\n|-----|--------------|\n| Start with a seed corpus | Dramatically speeds up initial coverage discovery |\n| Use `--sanitizer none` for safe Rust | 2x performance improvement |\n| Check coverage regularly | Identifies gaps in harness or seed corpus |\n| Use dictionaries for parsers | Helps overcome magic value checks |\n| Structure code as library | Required for cargo-fuzz integration |\n\n### libFuzzer Options\n\nPass options to libFuzzer after `--`:\n\n```bash\n# See all options\ncargo +nightly fuzz run fuzz_target_1 -- -help=1\n\n# Set timeout per run\ncargo +nightly fuzz run fuzz_target_1 -- -timeout=10\n\n# Use dictionary\ncargo +nightly fuzz run fuzz_target_1 -- -dict=dict.dict\n\n# Limit maximum input size\ncargo +nightly fuzz run fuzz_target_1 -- -max_len=1024\n```\n\n### Multi-Core Fuzzing\n\n```bash\n# Experimental forking support (not recommended)\ncargo +nightly fuzz run --jobs 1 fuzz_target_1\n```\n\nNote: The multi-core fuzzing feature is experimental and not recommended. For parallel fuzzing, consider running multiple instances manually or using AFL++.\n\n## Real-World Examples\n\n### Example: ogg Crate\n\nThe [ogg crate](https:\u002F\u002Fgithub.com\u002FRustAudio\u002Fogg) parses Ogg media container files. Parsers are excellent fuzzing targets because they handle untrusted data.\n\n```bash\n# Clone and initialize\ngit clone https:\u002F\u002Fgithub.com\u002FRustAudio\u002Fogg.git\ncd ogg\u002F\ncargo fuzz init\n```\n\nHarness at `fuzz\u002Ffuzz_targets\u002Ffuzz_target_1.rs`:\n\n```rust\n#![no_main]\n\nuse ogg::{PacketReader, PacketWriter};\nuse ogg::writing::PacketWriteEndInfo;\nuse std::io::Cursor;\nuse libfuzzer_sys::fuzz_target;\n\nfn harness(data: &[u8]) {\n    let mut pck_rdr = PacketReader::new(Cursor::new(data.to_vec()));\n    pck_rdr.delete_unread_packets();\n\n    let output = Vec::new();\n    let mut pck_wtr = PacketWriter::new(Cursor::new(output));\n\n    if let Ok(_) = pck_rdr.read_packet() {\n        if let Ok(r) = pck_rdr.read_packet() {\n            match r {\n                Some(pck) => {\n                    let inf = if pck.last_in_stream() {\n                        PacketWriteEndInfo::EndStream\n                    } else if pck.last_in_page() {\n                        PacketWriteEndInfo::EndPage\n                    } else {\n                        PacketWriteEndInfo::NormalPacket\n                    };\n                    let stream_serial = pck.stream_serial();\n                    let absgp_page = pck.absgp_page();\n                    let _ = pck_wtr.write_packet(\n                        pck.data, stream_serial, inf, absgp_page\n                    );\n                }\n                None => return,\n            }\n        }\n    }\n}\n\nfuzz_target!(|data: &[u8]| {\n    harness(data);\n});\n```\n\nSeed the corpus:\n```bash\nmkdir fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F\ncurl -o fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F320x240.ogg \\\n  https:\u002F\u002Fcommons.wikimedia.org\u002Fwiki\u002FFile:320x240.ogg\n```\n\nRun:\n```bash\ncargo +nightly fuzz run fuzz_target_1\n```\n\nAnalyze coverage:\n```bash\ncargo +nightly fuzz coverage fuzz_target_1\n.\u002Fgenerate_html fuzz_target_1 src\u002Flib.rs\n```\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| \"requires nightly\" error | Using stable toolchain | Use `cargo +nightly fuzz` |\n| Slow fuzzing performance | ASan enabled for safe Rust | Add `--sanitizer none` flag |\n| \"cannot find binary\" | No library crate | Move code from `main.rs` to `lib.rs` |\n| Sanitizer compilation issues | Wrong nightly version | Try different nightly: `rustup install nightly-2024-01-01` |\n| Low coverage | Missing seed corpus | Add sample inputs to `fuzz\u002Fcorpus\u002Ffuzz_target_1\u002F` |\n| Magic value not found | No dictionary | Create dictionary file with magic values |\n\n## Related Skills\n\n### Technique Skills\n\n| Skill | Use Case |\n|-------|----------|\n| **fuzz-harness-writing** | Structure-aware fuzzing with `arbitrary` crate |\n| **address-sanitizer** | Understanding ASan output and configuration |\n| **coverage-analysis** | Measuring and improving fuzzing effectiveness |\n| **fuzzing-corpus** | Building and managing seed corpora |\n| **fuzzing-dictionaries** | Creating dictionaries for format-aware fuzzing |\n\n### Related Fuzzers\n\n| Skill | When to Consider |\n|-------|------------------|\n| **libfuzzer** | Fuzzing C\u002FC++ code with similar workflow |\n| **aflpp** | Multi-core fuzzing or non-Cargo Rust projects |\n| **libafl** | Advanced fuzzing research or custom fuzzer development |\n\n## Resources\n\n**[Rust Fuzz Book - cargo-fuzz](https:\u002F\u002Frust-fuzz.github.io\u002Fbook\u002Fcargo-fuzz.html)**\nOfficial documentation for cargo-fuzz covering installation, usage, and advanced features.\n\n**[arbitrary crate documentation](https:\u002F\u002Fdocs.rs\u002Farbitrary\u002Flatest\u002Farbitrary\u002F)**\nGuide to structure-aware fuzzing with automatic derivation for Rust types.\n\n**[cargo-fuzz GitHub Repository](https:\u002F\u002Fgithub.com\u002Frust-fuzz\u002Fcargo-fuzz)**\nSource code, issue tracker, and examples for cargo-fuzz.\n",{"name":5,"type":23,"description":7},"fuzzer","main","f37de8f681f0c0ca0e0ebab6e5fddf764ca7553d","skills\u002Fcargo-fuzz",1,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one","https:\u002F\u002Fagisota.github.io\u002Fold-one\u002F","https:\u002F\u002Fgithub.com\u002Fagisota","pzd.world","2026-07-04 22:32:06",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add agisota\u002Fold-one --skill cargo-fuzz",{"tool":39,"command":40},"bunx","bunx skills add agisota\u002Fold-one --skill cargo-fuzz",{"tool":42,"command":43},"pnpm","pnpm dlx skills add agisota\u002Fold-one --skill cargo-fuzz","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fcargo-fuzz\u002FSKILL.md",true,[],[48,55,62,71,78,85],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":18},"01M75KRGZWQWE9JDBS6RX42NWV","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M75KRCZHKE0ZYAQFFYHS0YNP","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":66,"licenseFileUrl":67,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M75KR94KYQ30DTE1P9WNDAE0","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M75KR3H13YJ9QHMD49818FA1","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M75KQMPY8A4Y8XTDD2DT0M9T","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M75KQHNZ0ANZNJGZY6M8MDAK","x-api","X\u002FTwitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]