Agent skill · Audited from source
cargo-fuzz
skill · trailofbits/skillsCC-BY-SA-4.0 licenceAudited 30 Oct 2026 · source dea80e4aaaef
Is it safe? With care — CAUTION, grade B (89/100). We read this skill's source at commit dea80e4aaaef and found no filesystem, network or shell access and no hard-coded secrets. The audit raised 2 findings, 0 critical or high. What it does: Sets up and runs cargo-fuzz, the standard fuzzing tool for Cargo-based Rust projects. Covers cargo fuzz init, the nightly toolchain requirement, fuzz_target! harnesses, Arbitrary-derived structured inputs, sanitizer…
Cite
Cite this page
ModelsAtlas. “cargo-fuzz (trailofbits/skills)”. Retrieved 30 Oct 2026. https://modelsatlas.com/skills/trailofbits/cargo-fuzz
Trust audit
Audit 0.4.1 · source read 30 Oct 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade B is shared by 16,667 of 17,602 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 2 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (2)
MEDIUMInventory / provenanceinv.symlink · plugins/modern-python/hooks/shims/pip3
plugins/modern-python/hooks/shims/pip3
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · plugins/modern-python/hooks/shims/python3
plugins/modern-python/hooks/shims/python3
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha dea80e4aaaef · 30 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishertrailofbits GitHub organizationOwner of the repository this skill is read from
- Source foldertrailofbits/skills/plugins/testing-handbook-skills/skills/cargo-fuzzThe exact folder we audited
- LicenceCC-BY-SA-4.0As the repository states it
- Commit pinned for this verdictdea80e4aaaefA new audit runs when the source changes
- Repository statusNot archivedLast push 1 day ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Sets up and runs cargo-fuzz, the standard fuzzing tool for Cargo-based Rust projects. Covers cargo fuzz init, the nightly toolchain requirement, fuzz_target! harnesses, Arbitrary-derived structured inputs, sanitizer…
---
name: cargo-fuzz
type: fuzzer
description: "Sets up and runs cargo-fuzz, the standard fuzzing tool for Cargo-based Rust projects. Covers cargo fuzz init, the nightly toolchain requirement, fuzz_target! harnesses, Arbitrary-derived structured inputs, sanitizer options, cargo fuzz coverage, and reproducing a crash artifact. Use when fuzzing a Rust crate, writing a fuzz_target!, exercising unsafe blocks or FFI in Rust, or triaging a cargo fuzz crash."
---
# cargo-fuzz
cargo-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.
## When to Use
cargo-fuzz is currently the primary and most mature fuzzing solution for Rust projects using Cargo.
| Fuzzer | Best For | Complexity |
|--------|----------|------------|
| cargo-fuzz | Cargo-based Rust projects, quick setup | Low |
| AFL++ | Multi-core fuzzing, non-Cargo projects | Medium |
| LibAFL | Custom fuzzers, research, advanced use cases | High |
**Choose cargo-fuzz when:**
- Your project uses Cargo (required)
- You want simple, quick setup with minimal configuration
- You need integrated sanitizer support
- You're fuzzing Rust code with or without unsafe blocks
## Quick Start
```rust
#![no_main]
use libfuzzer_sys::fuzz_target;
fn harness(data: &[u8]) {
your_project::check_buf(data);
}
fuzz_target!(|data: &[u8]| {
harness(data);
});
```
Initialize and run:
```bash
cargo fuzz init
# Edit fuzz/fuzz_targets/fuzz_target_1.rs with your harness
cargo +nightly fuzz run fuzz_target_1
```
## Installation
cargo-fuzz requires the nightly Rust toolchain because it uses features only available in nightly.
### Prerequisites
- Rust and Cargo installed via [rustup](https://rustup.rs/)
- Nightly toolchain
### Linux/macOS
```bash
# Install nightly toolchain
rustup install nightly
# Install cargo-fuzz
cargo install cargo-fuzz
```
### Verification
```bash
cargo +nightly --version
cargo fuzz --version
```
## Writing a Harness
### Project Structure
cargo-fuzz works best when your code is structured as a library crate. If you have a binary project, split your `main.rs` into:
```text
src/main.rs # Entry point (main function)
src/lib.rs # Code to fuzz (public functions)
Cargo.toml
```
Initialize fuzzing:
```bash
cargo fuzz init
```
This creates:
```text
fuzz/
├── Cargo.toml
└── fuzz_targets/
└── fuzz_target_1.rs
```
### Harness Structure
```rust
#![no_main]
use libfuzzer_sys::fuzz_target;
fn harness(data: &[u8]) {
// 1. Validate input size if needed
if data.is_empty() {
return;
}
// 2. Call target function with fuzz data
your_project::target_function(data);
}
fuzz_target!(|data: &[u8]| {
harness(data);
});
```
### Harness Rules
| Do | Don't |
|----|-------|
| Structure code as library crate | Keep everything in main.rs |
| Use `fuzz_target!` macro | Write custom main function |
| Handle `Result::Err` gracefully | Panic on expected errors |
| Keep harness deterministic | Use random number generators |
> **See Also:** For detailed harness writing techniques and structure-aware fuzzing with the
> `arbitrary` crate, see the **fuzz-harness-writing** technique skill.
## Structure-Aware Fuzzing
cargo-fuzz integrates with the [arbitrary](https://github.com/rust-fuzz/arbitrary) crate for structure-aware fuzzing:
```rust
// In your library crate
use arbitrary::Arbitrary;
#[derive(Debug, Arbitrary)]
pub struct Name {
data: String
}
```
```rust
// In your fuzz target
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: your_project::Name| {
data.check_buf();
});
```
Add to your library's `Cargo.toml`:
```toml
[dependencies]
arbitrary = { version = "1", features = ["derive"] }
```
## Running Campaigns
### Basic Run
```bash
cargo +nightly fuzz run fuzz_target_1
```
### Without Sanitizers (Safe Rust)
If your project doesn't use unsafe Rust, disable sanitizers for 2x performance boost:
```bash
cargo +nightly fuzz run --sanitizer none fuzz_target_1
```
Check if your project uses unsafe code:
```bash
cargo install cargo-geiger
cargo geiger
```
### Re-executing Test Cases
```bash
# Run a specific test case (e.g., a crash)
cargo +nightly fuzz run fuzz_target_1 fuzz/artifacts/fuzz_target_1/crash-<hash>
# Run all corpus entries without fuzzing
cargo +nightly fuzz run fuzz_target_1 fuzz/corpus/fuzz_target_1 -- -runs=0
```
### Using Dictionaries
```bash
cargo +nightly fuzz run fuzz_target_1 -- -dict=./dict.dict
```
### Interpreting Output
| Output | Meaning |
|--------|---------|
| `NEW` | New coverage-increasing input discovered |
| `pulse` | Periodic status update |
| `INITED` | Fuzzer initialized successfully |
| Crash with stack trace | Bug found, saved to `fuzz/artifacts/` |
Corpus location: `fuzz/corpus/fuzz_target_1/`
Crashes location: `fuzz/artifacts/fuzz_target_1/`
## Sanitizer Integration
### AddressSanitizer (ASan)
ASan is enabled by default and detects memory errors:
```bash
cargo +nightly fuzz run fuzz_target_1
```
### Disabling Sanitizers
For pure safe Rust (no unsafe blocks in your code or dependencies):
```bash
cargo +nightly fuzz run --sanitizer none fuzz_target_1
```
**Performance impact:** ASan adds ~2x overhead. Disable for safe Rust to improve fuzzing speed.
### Checking for Unsafe Code
```bash
cargo install cargo-geiger
cargo geiger
```
> **See Also:** For detailed sanitizer configuration, flags, and troubleshooting,
> see the **address-sanitizer** technique skill.
## Coverage Analysis
cargo-fuzz integrates with Rust's coverage tools to analyze fuzzing effectiveness.
### Prerequisites
```bash
rustup toolchain install nightly --component llvm-tools-preview
cargo install cargo-binutils
cargo install rustfilt
```
### Generating Coverage Reports
```bash
# Generate coverage data from corpus
cargo +nightly fuzz cExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit dea80e4
git clone https://github.com/RustAudio/ogg.git
git clone https://github.com/trailofbits/skills git -C skills checkout dea80e4aaaef
Commands as the repository documents them: shown, never run by us. Our verdict covers commit dea80e4aaaef only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Cursor | Mentioned in its text, not tested | Skills for Cursor · About Cursor |
Audit history
Every audit, every source change
- !CAUTION B 89 / 100
first audit · source
dea80e4aaaef
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/trailofbits/cargo-fuzz/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
anthropics/skills
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com),…
anthropics/skills
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.…
anthropics/skills
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design…
anthropics/skills
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual…
anthropics/skills
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or…
anthropics/skills
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users…
Add this badge to your README
[](https://modelsatlas.com/skills/trailofbits/cargo-fuzz/)
<a href="https://modelsatlas.com/skills/trailofbits/cargo-fuzz/"><img src="https://modelsatlas.com/skills/trailofbits/cargo-fuzz/badge.svg" alt="ModelsAtlas: CAUTION B"></a>
Questions about cargo-fuzz
What does the cargo-fuzz skill do?
Is cargo-fuzz safe to install?
What can cargo-fuzz access on my machine?
Which assistants does cargo-fuzz work with?
How current is this page?
Sources
- github.com/trailofbits/skills/tree/main/plugins/testing-handbook — the audited source at commit dea80e4aaaef and every finding aboveObserved · 30 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the cargo-fuzz skill do?
- Is cargo-fuzz safe to install?
- What can cargo-fuzz access on my machine?