Skip to content

feat: add top-level cargo-fuzz harness for protocol wire parser#4046

Merged
oferchen merged 1 commit into
masterfrom
feat/protocol-fuzz-harness
May 14, 2026
Merged

feat: add top-level cargo-fuzz harness for protocol wire parser#4046
oferchen merged 1 commit into
masterfrom
feat/protocol-fuzz-harness

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Scaffolds a top-level fuzz/ crate following the canonical cargo-fuzz layout, with a single minimal target (protocol_wire) that drives protocol::BorrowedMessageFrames against arbitrary bytes from libFuzzer.
  • The multiplex frame decoder is the highest-level entry point that consumes bytes from network peers, so coverage-guided exploration fans out into header validation, payload-length checks, and message-code decoding without needing per-path harnesses.
  • Excludes the fuzz crate from the root workspace so libfuzzer-sys does not leak into ordinary cargo build runs. A complementary crates/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=60 smoke-runs cleanly locally
  • cargo build --workspace still succeeds (fuzz crate is excluded from the root workspace)
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings

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
@github-actions github-actions Bot added the enhancement New feature or request label May 14, 2026
@oferchen oferchen merged commit 4024bcf into master May 14, 2026
40 checks passed
@oferchen oferchen deleted the feat/protocol-fuzz-harness branch May 14, 2026 14:57
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant