Skip to content

Coverage-guided fuzzing (cargo-fuzz) for SaveFile::from_bytes and accessors #34

Description

@kasbuunk

The proptest panic sweep from issue #4 (75k+ cases, zero panics) is strong but not coverage-guided; a libFuzzer target explores byte patterns proptest's generators never produce, closing the last gap in the no-panic-from-file-contents guarantee for the wasm build where a panic is a DoS.

Instructions:

  1. cargo fuzz init in crates/pksave with a target that runs from_bytes on arbitrary bytes, then walks every view/diagnostic like the existing sweep harness (reuse its accessor-walk function — extract it to a #[doc(hidden)] helper or a shared test-support module).
  2. Seed the corpus with the e2e fixtures and new_empty() output; run locally ≥1 CPU-hour; commit the minimized corpus.
  3. Optional CI: a scheduled short run (-max_total_time=300) — nightly-only since libFuzzer needs it; keep it off the PR path.

Alternatives considered
The existing proptest sweep already gates this class of bug and runs on stable in CI; this is defense-in-depth, priority low.
AFL++ works without nightly but integrates worse with cargo and CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions