Skip to content

docs(fuzz): reproducible harness guide for auditors - #225

Merged
lecodev-26 merged 3 commits into
lecodev-26:mainfrom
v1rtu3x:docs/fuzz-reproducible-harnesses
Nov 25, 2026
Merged

lecodev-26 merged 3 commits into
lecodev-26:mainfrom
v1rtu3x:docs/fuzz-reproducible-harnesses

Conversation

@v1rtu3x

@v1rtu3x v1rtu3x commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Hi,

This overhauls fuzz/README.md so an auditor can go from a clean checkout to building all nine fuzz harnesses, running bounded campaigns with the exact CI flags, and reproducing crashes from retained CI artifacts. Related tracking issue: #93 (left open; separate ownership).

Summary

The README now documents: the nine targets grouped by surface (parsers / vault & storage decoders / crypto / policies) with per-target campaign coverage; toolchain requirements with verified versions; build and run commands using the exact CI flags; seed corpus location and limits; the weekly-matrix vs. four-hour-soak campaign structure including the merged #222 artifact layout (fuzz-results/<target>/run-<id>-attempt-<n>/ and the report.json contract); and step-by-step crash reproduction and minimization from downloaded artifacts, with explicit guidance that crash inputs and corpus data must never expose secrets or be committed.

Per review feedback, fuzz/Cargo.lock is committed rather than ignored, giving auditors reproducible dependency resolution from a clean checkout.

Related issue or discussion

Related tracking issue: #93 (left open; separate ownership). Scope coordinated with the maintainers on the issue; related work tracked separately in discussions #175 and #181 (linked in the README, not implemented here).

Change type

  • Bug fix
  • Feature
  • Security hardening
  • Documentation
  • Refactoring / maintenance
  • CI / tooling

Security and correctness impact

No code, workflow, or harness is modified. The security impact is positive and indirect: auditors can independently reproduce fuzz evidence, and the documentation reinforces CONTRIBUTING §3 (crash artifacts and secrets are never committed). Two scope-adjacent guardrails are included: .gitignore rules for fuzz/corpus/ and fuzz/artifacts/, so following the documented commands no longer leaves generated corpus files and crash artifacts one git add . away from being committed. Happy to split these into a separate PR if you prefer.

Compatibility and migration

None — documentation, two .gitignore entries, and a committed fuzz/Cargo.lock. No API, format, dependency-version, MSRV, or platform impact (the lockfile pins the fuzz workspace's existing resolution; it does not change it). Rollback is a revert of these two commits.

Validation evidence

  • Relevant tests added or updated.
  • Exact local checks and results are listed below.
  • GitHub Actions checks reviewed for the latest PR HEAD SHA.
  • Documentation updated where needed.

Every command in the README was executed verbatim from a fresh git clone --recurse-submodules:

  • Toolchain: rustup toolchain install nightly --component rust-src → OK; cargo install cargo-fuzz --locked → 0.13.2.
  • Build: cargo +nightly fuzz build → exit 0, all nine binaries present; cargo +nightly fuzz list matches the documented inventory exactly.
  • Lockfile reproducibility: with fuzz/Cargo.lock committed, a fresh clone followed by the documented build leaves it unmodified (git diff --exit-code clean) — verified under a newer nightly (739adecd4, 2026-11-24) than the one that generated it (20fe935d5, 2026-11-23).
  • Campaigns: 30s vault_parse run with the CI flags → exit 0, 334,838 runs, 689 corpus files, 0 artifacts; mldsa_key_decode with empty corpus → exit 0 (see note below).
  • Reproduction: single-input runs against a synthetic input and a real input from CI artifact fuzz-campaign-vault_parse (run 45159196337) → both exit 0; tmin behavior on a non-crashing input documented as observed; -artifact_prefix directory requirement verified against real error output.
  • Artifact download and layout verified with gh run download.

Two behaviors could not be exercised (a real harness crash — none exists to trigger; soak artifact download — no soak run has been dispatched since #222 merged) and are documented from the merged workflow/finalizer source, phrased conditionally. Note on the cargo-audit check: it fails on main as well (scheduled run 45213177110, on this branch's base commit) due to a newly published advisory; this PR touches no root dependencies.

Limitations and follow-up

  • Reported, not fixed: SECURITY.md's "Security gates" paragraph describes a 45-minute soak and a 5-minute V2 PR gate; the merged reality is a 4-hour soak and a weekly 10-minute matrix. Left untouched here — happy to follow up separately.
  • Observation: in the sampled campaigns observed so far (local 30-second runs and CI run 45159196337, observed 2026-11-23), mldsa_key_decode generated inputs took the same early rejection path and no corpus units were added. Documented in the README as a dated, bounded note; happy to file a tracking issue if you'd like it tracked.
  • Filename note: fuzz-nightly.yml runs weekly (Mondays 02:17 UTC); the README documents the actual schedule.
  • Out of scope as coordinated: six-target soak coverage (discussion Nexus-Q fuzz audit: six fuzz targets are missing from the four-hour soak #175) and PR-CI fuzz builds (discussion Nexus-Q fuzz audit: fuzz harnesses are not built in pull-request CI #181).

Contributor checklist

  • This PR is focused and ready for review.
  • I have read CONTRIBUTING.md and relevant parts of AGENT.md.
  • No credentials, private keys, vault data, customer data, or other secrets are included.
  • Third-party license notices and provenance are preserved.
  • I understand green CI is not an external security audit or certification.

Happy to adjust the structure, level of detail, or scope if that makes review easier — just let me know.

@v1rtu3x
v1rtu3x requested a review from lecodev-26 as a code owner November 24, 2026 13:05
@v1rtu3x

v1rtu3x commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

A note on the failing check: cargo-audit (all lockfiles) is failing on main too — the scheduled run yesterday (45213177110, on e18ddae, the exact commit this branch is based on) failed the same way, while the last push run on main (2026-11-20) was green. A new RustSec advisory seems to have landed in between. This PR touches only fuzz/README.md and .gitignore — no lockfiles or dependencies.

Happy to help investigate the advisory separately if useful; otherwise I'll wait for main to go green and rebase.

@lecodev-26

lecodev-26 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Thanks, Mark — this is a thorough guide and it stays within the agreed scope for #93. I reviewed the documentation and compared the commands and campaign descriptions against the current fuzz workflows.

Before we consider it ready, could you please make two small follow-ups?

  1. Keep the fuzz workspace dependency resolution reproducible. The PR currently adds fuzz/Cargo.lock to .gitignore. Since fuzz/ is an independent Cargo workspace, please consider committing its generated Cargo.lock instead of ignoring it. That gives auditors a reproducible dependency resolution for the documented clean-checkout workflow. If there is a specific technical reason not to track it, please explain that in the PR and document how the fuzz dependencies are kept reproducible.
  2. Narrow the ML-DSA corpus statement. The note currently says every generated input takes the same early rejection path. Please phrase this as an observation from the runs you inspected (for example, “the sampled campaigns observed so far…”), rather than an unconditional statement about every possible input.

Please push the updates to this PR when ready and let us know. No need to expand the scope into discussions #175 or #181.

Thanks again for taking this on.

@v1rtu3x v1rtu3x left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — both follow-ups are in 751bc04:

  1. fuzz/Cargo.lock is now committed instead of ignored, and the README explains why: a committed lockfile gives auditors reproducible dependency resolution from a clean checkout. Verified end-to-end: fresh clone → documented build → git diff --exit-code confirms the lockfile unmodified, including under a newer nightly (739adecd4) than the one that generated it (20fe935d5).
  2. The ML-DSA corpus note is now a bounded, dated observation ("in the sampled campaigns observed so far — local 30-second runs and CI run 45159196337 — …"), explicitly framed as an observation rather than a property of the harness.

The PR body's scope note is updated to reflect the two remaining .gitignore rules (fuzz/corpus/, fuzz/artifacts/).

@v1rtu3x v1rtu3x left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An update on the two failing checks — both are the same pre-existing advisory, not this change:

  • Both cargo-audit (all lockfiles) and Enforce dependency policy fail on RUSTSEC-2026-0592 (url crate) in the root workspace lockfile. cargo-audit has failed on main the same way since the advisory was published (scheduled run 45213177110, on this branch's base commit).
  • Enforce dependency policy triggered on this PR because adding fuzz/Cargo.lock matches its **/Cargo.lock path filter, but its checks cover the root and native lockfiles only — fuzz/Cargo.lock itself is scanned by neither workflow.
  • Fast CI is green.

Happy to help with the advisory in a separate PR if useful (e.g. a url bump or a time-limited exception, whichever you prefer) — I'll leave the triage call to you.

@lecodev-26

Copy link
Copy Markdown
Owner

Thanks, Mark — this is a good PR and the updates look good. We’ll take ownership of the remaining CI issues and handle the dependency/policy fixes on our side, so you don’t need to expand the scope of this PR. Appreciate the work!

@lecodev-26
lecodev-26 merged commit 0d607f2 into lecodev-26:main Nov 25, 2026
3 checks passed
@lecodev-26

Copy link
Copy Markdown
Owner

CI verificado en GitHub Actions sobre el HEAD e14a82ddac0d20d05b847341c74ff1842d14bbf2: Dependency Policy PASS, Fast CI PASS y Cargo Audit PASS (3/3). PR integrado mediante squash. Merge commit: 0d607f2e0ac6660c7b6865df00c6990928236165. Resumen: guía reproducible para los nueve harnesses de fuzzing, comandos y flags de CI, campañas y recuperación/minimización de artefactos; lockfile de fuzz y exclusión de corpus/artefactos generados. La issue #93 queda abierta y fuera del alcance de este merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants