fuzzing-rust-expert
Skill13k starsChanged 10 months agoApache-2.0View on GitHub
This skill provides the agent with the knowledge and tools to write, build, and validate fuzz targets for Rust projects integrated into OSS-Fuzz. Rust fuzzing uses cargo-fuzz with the libfuzzer_sys crate, which drives libFuzzer. Rust projects must use the Rust base builder image: Set language: rust in project.yaml. Rust fuzz targets live in fuzz/fuzz_targets/<name>.rs within the crate being fuzzed. The minimal harness using raw bytes: For structured fuzzing using the arbitrary crate (preferred when the target expects typed input): The…
Trending
Quiet since June.about the whole repository
Who's talking about google/oss-fuzz
- A Hacker News story“OSS-Fuzz – Continuous Fuzzing for Open Source Software”Hacker News · Mar 1, 2018 · 74 points
- rust-lang/rust“proposal: make fuzzing a first class citizen”GitHub · Feb 17, 2017 · 70 reactions
- godotengine/godot-proposals“Add Godot Engine to oss-fuzz”GitHub · Oct 19, 2019 · 23 reactions
- @graemerocher.bsky.social“Some tremendous work by @yawk.at happening at github.com/micronaut-pr... Thanks to OSSFuzz billions of fuzz …”Bluesky · Jan 30, 2025 · 18 likes
- A Hacker News story“Xz: Disable ifunc to fix Issue 60259”Hacker News · Mar 29, 2024 · 18 points
The biggest 5 of 33 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 33
Talked about on GitHub, Hacker News and Bluesky (33 times).
On GitHub · 21
- Feb 17, 2017proposal: make fuzzing a first class citizen — rust-lang/rust70 reactions · 8 comments
- Oct 19, 2019Add Godot Engine to oss-fuzz — godotengine/godot-proposals23 reactions · 9 comments
- Oct 24, 2023Multiprocess tracking issue — bitcoin/bitcoin12 reactions · 2 comments
- Dec 3, 2020Added 2 fuzzers — go-gitea/gitea8 reactions · 21 comments
- Apr 22, 2024Node.js Security team Meeting 2024-04-25 — nodejs/security-wg6 reactions · 1 comment
16 more on GitHub
- Jan 15, 2024Node.js Security team Meeting 2024-01-18 — nodejs/security-wg6 reactions · 1 comment
- Dec 18, 2023Node.js Security team Meeting 2023-12-21 — nodejs/security-wg6 reactions · 2 comments
- Apr 8, 2024Fuzzing — envoyproxy/gateway5 reactions · 11 comments
- Jul 25, 2017have a go with oss-fuzz — libvips/libvips5 reactions · 10 comments
- May 20, 2024Node.js Security team Meeting 2024-05-23 — nodejs/security-wg4 reactions
- May 6, 2024Node.js Security team Meeting 2024-05-09 — nodejs/security-wg4 reactions
- Mar 25, 2024Node.js Security team Meeting 2024-03-28 — nodejs/security-wg4 reactions · 2 comments
- Mar 11, 2024Node.js Security team Meeting 2024-03-14 — nodejs/security-wg4 reactions · 3 comments
- Jan 29, 2024Node.js Security team Meeting 2024-02-01 — nodejs/security-wg4 reactions · 3 comments
- Dec 4, 2023Node.js Security team Meeting 2023-12-07 — nodejs/security-wg4 reactions · 2 comments
- Nov 4, 2022moving quic-go to its own org: quic-go/quic-go — quic-go/quic-go4 reactions · 16 comments
- Nov 24, 2020Continuous fuzzing by way of OSS-Fuzz integration — SerenityOS/serenity4 reactions · 18 comments
- Apr 13, 2020Integrating with OSS-Fuzz — bitcoin-core/secp256k14 reactions · 19 comments
- Mar 31, 2020Fuzzing Lua (LuaJit) in Tarantool — tarantool/tarantool4 reactions · 5 comments
- Jun 10, 2026OSS-Fuzz issue 522117389 — google/flatbuffers3 reactions
- Apr 8, 2026Support TSAN — tarantool/tarantool3 reactions · 4 comments
On Hacker News · 10
- Mar 1, 2018OSS-Fuzz – Continuous Fuzzing for Open Source Software74 points · 5 comments
- Mar 29, 2024Xz: Disable ifunc to fix Issue 6025918 points · 2 comments
- Jul 10, 2023Fixed Spelling Errors or Typos12 points · 3 comments
- Dec 6, 2022OSS-Fuzz – continuous fuzzing for open source software3 points · 1 comment
- Oct 31, 2016Google releases oss-fuzz: continuous fuzzing of open source software3 points
5 more on Hacker News
- Nov 28, 2017OSS-Fuzz2 points
- May 13, 2017OSS-Fuzz – continuous fuzzing of open source software2 points
- Nov 1, 2016Oss-fuzz: continuous fuzzing of open source software2 points
- Dec 2, 2016OSS-Fuzz – Continuous Fuzzing for Open Source Software1 point
- Oct 13, 2016Applying coverage-guided fuzzing on scale to Open Source Software1 point
On Bluesky · 2
- Jan 30, 2025Some tremendous work by @yawk.at happening at github.com/micronaut-pr... Thanks to OSSFuzz billions of fuzz tests (yes billions!) are being… — @graemerocher.bsky.social18 likes and reposts
- Mar 11, 2021Include a comprehensive test suite with test archives with the code. Add the project to OSS-Fuzz (https://github.com/google/oss-fuzz). I… — @admvonschneider.bsky.social0 likes and reposts · 1 reply
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- fuzzing-go-expertSkill
- fuzzing-jvm-expertSkill
- fuzzing-memory-unsafe-expertSkill
- fuzzing-python-expertSkill
- oss-fuzz-engineerSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 100
If the project requires a nightly toolchain, set it in the Dockerfile:
- Very specific: line 114
Place seed files in fuzz/corpus/<target_name>/ within the repo.
- Very specific: line 132
Avoids panicking on every input: do not use .unwrap() or .expect() on fallible operations driven by fuzz input — these create false …
- Very specific: line 136
Is fast: avoid I/O, heavy allocations, or expensive setup inside the callback.
- Very specific: line 139
Considers
unsafecode: if the crate has unsafe blocks, write harnesses that exercise those paths — this is where memory bugs can still … - Very specific: line 151
unsafebugs: use-after-free, out-of-bounds reads/writes, undefined behaviour in unsafe blocks — these are real memory bugs. - Very specific: line 167
Run cargo build and cargo test inside the crate before adding the fuzz harness to catch pre-existing compilation errors.
- Very specific: line 169
When iterating locally clone the upstream repo and switch the Dockerfile from RUN git clone to COPY to avoid network round-trips.
- Very specific: line 171
If the crate uses no_std, use libfuzzer-sys's no_std feature and ensure the harness does not rely on std.
- Distinctive: line 173
Document why each entry point was chosen and what class of bugs it may find.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fuzzing Rust expert
This skill provides the agent with the knowledge and tools to write, build, and
validate fuzz targets for Rust projects integrated into OSS-Fuzz. Rust fuzzing
uses cargo-fuzz with the libfuzzer_sys crate, which drives libFuzzer.
Fundamental Concepts
OSS-Fuzz base image
Rust projects must use the Rust base builder image:
FROM gcr.io/oss-fuzz-base/base-builder-rustSet language: rust in project.yaml.
Harness structure
Rust fuzz targets live in fuzz/fuzz_targets/<name>.rs within the crate being
fuzzed. The minimal harness using raw bytes:
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
// Call into the target. The fuzzer will mutate `data` on every iteration.
let _ = my_crate::parse(data);
});For structured fuzzing using the arbitrary crate (preferred when the target
expects typed input):
#![no_main]
use libfuzzer_sys::fuzz_target;
use arbitrary::Arbitrary;
#[derive(Debug, Arbitrary)]
struct MyInput {
header: u8,
payload: Vec<u8>,
flags: u32,
}
fuzz_target!(|input: MyInput| {
let _ = my_crate::process(input.header, &input.payload, input.flags);
});The Cargo.toml for the fuzz directory must declare dependencies:
# fuzz/Cargo.toml
[package]
name = "my-crate-fuzz"
version = "0.0.0"
edition = "2021"
publish = false
[dependencies]
libfuzzer-sys = "0.4"
arbitrary = { version = "1", features = ["derive"] } # only if using structured fuzzing
[dependencies.my-crate]
path = ".."
[[bin]]
name = "fuzz_target_name"
path = "fuzz_targets/fuzz_target_name.rs"
test = false
doc = falseBuilding in OSS-Fuzz
build.sh uses cargo fuzz build and then copies binaries to $OUT:
# build.sh
cd $SRC/<crate-dir>
cargo fuzz build -O # -O enables release optimisations; important for performance
FUZZ_TARGET_OUTPUT_DIR=$SRC/<crate-dir>/target/x86_64-unknown-linux-gnu/release
for f in fuzz/fuzz_targets/*.rs; do
name=$(basename "${f%.*}")
cp "$FUZZ_TARGET_OUTPUT_DIR/$name" "$OUT/"
doneIf the project requires a nightly toolchain, set it in the Dockerfile:
ENV RUSTUP_TOOLCHAIN=nightlyOr pin to a specific nightly for reproducibility:
ENV RUSTUP_TOOLCHAIN=nightly-2025-07-03Seed corpus and dictionaries
- Place seed files in
fuzz/corpus/<target_name>/within the repo; they are automatically picked up by cargo-fuzz and can be zipped for OSS-Fuzz. - To ship a corpus with OSS-Fuzz copy a zip to
$OUT/<target_name>_seed_corpus.zip. - Dictionaries go to
$OUT/<target_name>.dict. - For targets that parse a structured format, generating seeds with a script
beats hand-picking a few files — random mutation rarely passes the parser's
early checks (note: cargo-fuzz's
arbitraryis the better route when the target takes typed data rather than a byte format). See the structured seed generation reference.
Characteristics of good Rust fuzzing harnesses
- Targets attack surface: parsers, deserializers, protocol implementations, unsafe blocks, and any API that processes untrusted bytes.
- Uses structured fuzzing (
arbitrary) when the target expects typed data rather than raw bytes — this dramatically improves coverage. - Handles expected errors:
ResultandOptionshould be let-bound and ignored (let _ = ...). Only actual panics are findings. - Avoids panicking on every input: do not use
.unwrap()or.expect()on fallible operations driven by fuzz input — these create false positives. - Avoids non-determinism: no
rand, no system time, no thread spawning inside the fuzz callback. - Is fast: avoid I/O, heavy allocations, or expensive setup inside the
callback; do those outside the
fuzz_target!macro if needed withLazyLock/OnceLock. - Considers
unsafecode: if the crate hasunsafeblocks, write harnesses that exercise those paths — this is where memory bugs can still occur in Rust. - Builds in release mode (
-O): fuzzing in debug mode is much slower.
What Rust fuzzing finds
Rust's ownership model prevents most memory-corruption bugs, but fuzzing still finds:
- Panics:
unwrap/expectonNone/Err, index out of bounds, arithmetic overflow in debug mode, explicitpanic!calls. unsafebugs: use-after-free, out-of-bounds reads/writes, undefined behaviour inunsafeblocks — these are real memory bugs.- Logic errors: incorrect parsing, data corruption, wrong output.
- Hangs: infinite loops triggered by crafted input.
- Stack overflows: deep recursion on adversarial input.
Operational guidelines
- Always validate with:
python3 infra/helper.py build_fuzzers <project> python3 infra/helper.py check_build <project> python3 infra/helper.py run_fuzzer <project> <fuzzer_name> -- -max_total_time=30 - An instant crash usually means a
panic!on every input — check for.unwrap()calls on fuzz-driven paths and replace withif letor?. - Run
cargo buildandcargo testinside the crate before adding the fuzz harness to catch pre-existing compilation errors. - When iterating locally clone the upstream repo and switch the Dockerfile from
RUN git clonetoCOPYto avoid network round-trips. - If the crate uses
no_std, uselibfuzzer-sys'sno_stdfeature and ensure the harness does not rely onstd. - Document why each entry point was chosen and what class of bugs it may find.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

