onionwire/fuzz
Repository files (latest commit first)
Filename Latest commit message Latest commit date
agent a03ee5db82
Some checks failed
ci / test (pull_request) Has been cancelled
ci / sdk (pull_request) Has been cancelled
ci / fuzz (pull_request) Has been cancelled
ci: remove panic from qr_decode — green verification for crash-proof (THROWAWAY)
2026-09-17 22:12:19 -04:00
..
fuzz_targets ci: remove panic from qr_decode — green verification for crash-proof (THROWAWAY) 2026-09-17 22:12:19 -04:00
seeds fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:25:14 -04:00
.gitignore fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:25:14 -04:00
Cargo.lock fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:25:14 -04:00
Cargo.toml fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:25:14 -04:00
README.md fuzz: cargo-fuzz harness for the ratchet/qr/dispatch/file parsers 2026-09-17 21:25:14 -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.