feat: add top-level cargo-fuzz harness for protocol wire parser#4046
Merged
Conversation
Set up a cargo-fuzz scaffold at the repository root so contributors and CI can fuzz the multiplex frame parser - the highest-level entry point that consumes untrusted bytes from network peers. Coverage-guided exploration will fan out across header validation, payload-length checks, and message-code decoding without needing per-path harnesses. The fuzz crate is excluded from the root workspace so libfuzzer-sys does not leak into ordinary `cargo build` runs. Refs #1195 #1291 #1293 #1304 #2103
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Set up a cargo-fuzz scaffold at the repository root so contributors and CI can fuzz the multiplex frame parser - the highest-level entry point that consumes untrusted bytes from network peers. Coverage-guided exploration will fan out across header validation, payload-length checks, and message-code decoding without needing per-path harnesses. The fuzz crate is excluded from the root workspace so libfuzzer-sys does not leak into ordinary `cargo build` runs. Refs #1195 #1291 #1293 #1304 #2103
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Set up a cargo-fuzz scaffold at the repository root so contributors and CI can fuzz the multiplex frame parser - the highest-level entry point that consumes untrusted bytes from network peers. Coverage-guided exploration will fan out across header validation, payload-length checks, and message-code decoding without needing per-path harnesses. The fuzz crate is excluded from the root workspace so libfuzzer-sys does not leak into ordinary `cargo build` runs. Refs #1195 #1291 #1293 #1304 #2103
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fuzz/crate following the canonical cargo-fuzz layout, with a single minimal target (protocol_wire) that drivesprotocol::BorrowedMessageFramesagainst arbitrary bytes from libFuzzer.libfuzzer-sysdoes not leak into ordinarycargo buildruns. A complementarycrates/protocol/fuzz/workspace already ships specialised targets (varint, delta, legacy greeting); the new top-level harness is the recommended starting point for new contributors and for CI integration.Motivation
The protocol parser handles untrusted bytes from network peers. A malformed packet from a hostile sender could exploit a parser bug. Upstream rsync ships no published fuzzing harness despite the same attack surface, so adding one on the Rust side is a clear hardening win. This PR sets up the scaffold; actual long-running fuzz campaigns and corpus seeding are tracked separately.
Follow-up work
Test plan
cargo +nightly fuzz run protocol_wire -- -max_total_time=60smoke-runs cleanly locallycargo build --workspacestill succeeds (fuzz crate is excluded from the root workspace)cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings