onionwire/fuzz
Repository files (latest commit first)
Filename Latest commit message Latest commit date
agent 9d93fb5cfa
fuzz: pass the 4th bootstrap arg (hybrid ML-KEM peer key)
RatchetState::bootstrap gained remote_kem_pub in b22abd7 (PR #185), so the
fuzz target has not compiled since 2026-10-20 and the nightly fuzz job has
been red for ten days.

Pass None for the classical shape and a real ML-KEM-768 encapsulation key
(crate::kem::PK_LEN bytes, built once from a fixed 64-byte seed) for the
hybrid shape, so both bootstrap paths are fuzzed. The invariants are
unchanged: arbitrary bytes never panic, a parsed state re-serializes, and a
rejected frame rolls back to the exact pre-decrypt state.
2026-10-30 23:24:58 -04:00
..
fuzz_targets fuzz: pass the 4th bootstrap arg (hybrid ML-KEM peer key) 2026-10-30 23:24:58 -04:00
seeds fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 20:52:44 -04:00
.gitignore fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 20:52:44 -04:00
Cargo.lock fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 20:52:44 -04:00
Cargo.toml fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 20:52:44 -04:00
README.md fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 20:52:44 -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.