onionwire/fuzz
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-17 21:04:45 -04:00
..
fuzz_targets ci: crash-test — inject panic in qr_decode to prove the fuzz job fails on a crash (REVERT BEFORE MERGE) 2026-09-17 21:04:45 -04:00
seeds fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:04:20 -04:00
.gitignore fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:04:20 -04:00
Cargo.lock fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:04:20 -04:00
Cargo.toml fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:04:20 -04:00
README.md fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:04:20 -04:00

Fuzzing OnionWire

Structured fuzzing for the four parsers that eat untrusted peer input. A crash here is a remote-triggerable panic, so a reproducer must be fixed in src/ and then folded into fuzz/seeds/<target>/ as a regression input.

target entry points
ratchet_frame ratchet::RatchetState::from_bytes, RatchetState::decrypt (the rat frame parser)
qr_decode qr::decode (pasted/scanned invite strings)
dispatch_classify dispatch::classify (routes a rat frame to the ratchet parser)
file_decode file::decode (fil chunk frames)

Nothing in src/ changes for this: every target calls the shipped public API.

rustup toolchain install nightly --profile minimal
cargo install cargo-fuzz
scripts/run-fuzz.sh              # all four, 60s each
FUZZ_SECS=300 scripts/run-fuzz.sh ratchet_frame

fuzz/corpus/ is gitignored (libFuzzer grows it locally); fuzz/seeds/ is committed and copied in by the script. Crash reproducers land in fuzz/artifacts/<target>/. Needs rustup's cargo on PATH — the +nightly directive does not work through a distro cargo package.