Skip to content

ci(fuzz): wire every fuzz target, and fail when one is not - #351

Open
Jaro-c wants to merge 1 commit into
developfrom
ci/wire-every-fuzz-target
Open

Jaro-c wants to merge 1 commit into
developfrom
ci/wire-every-fuzz-target

Conversation

@Jaro-c

@Jaro-c Jaro-c commented Sep 7, 2026

Copy link
Copy Markdown
Member

Five of the fourteen fuzz targets in the tree were missing from fuzz.yml: FuzzVerify in auth/credential, FuzzDecrypt and FuzzEncryptDecrypt in auth/field, and FuzzVerify and FuzzVerifyRecoveryCode in auth/totp. All five belong to the three newest modules, which is to say the least reviewed code in the repository was also the code that was never fuzzed.

Nothing went red over it, and that is the part worth fixing. go test runs a fuzz target once over its seed corpus, so an unwired target still passes the suite and still reports as a test. The 60s budget, the mutation and the persisted per-target corpus all live in the scheduled job.

So I added the five entries, and then a test that compares the tree against the workflow. It walks for functions named Fuzz* taking a single *testing.F and diffs that set against the targets block, in both directions, so a target that is added without being wired fails on its own pull request, and an entry naming a target that no longer exists fails too. It parses the block with encoding/json rather than a YAML library, since the block is a folded scalar holding JSON, so it adds no dependency.

I checked it fails in the direction that matters rather than assuming: removing FuzzVerifyRecoveryCode from the workflow turns it red naming that target, and I confirmed the edit had actually changed the file before reading the red.

Closes #343

Five of the fourteen fuzz targets in the tree were missing from the
scheduled job: FuzzVerify in auth/credential, FuzzDecrypt and
FuzzEncryptDecrypt in auth/field, and FuzzVerify and
FuzzVerifyRecoveryCode in auth/totp. All five belong to the three
newest modules.

Nothing went red over it. `go test` runs a fuzz target once over its
seed corpus, so an unwired target still passes the suite and still
reports as a test. The 60s budget, the mutation and the persisted
corpus all live in the scheduled job, so those five had never been
fuzzed at all.

I added the five entries, and then a test that compares the tree
against the workflow so the next module cannot repeat this. It parses
the targets block with the standard library, since the block is a
folded scalar holding JSON, so it adds no dependency.

I checked it fails in the direction that matters: removing
FuzzVerifyRecoveryCode from the workflow turns it red with the name of
the target that stopped being fuzzed.

Closes #343

Signed-off-by: Jose <75870284+Jaro-c@users.noreply.github.com>
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.

1 participant