Skip to content

12 of the 22 fuzz targets are never fuzzed by CI, including the one that decides whether checksums are verified #565

Closed

Description

@scttfrdmn

The gap

ci.yml's fuzz-smoke matrix names 10 fuzz targets. The repository has 22. The twelve that
are absent run only their committed seed corpus, as ordinary unit tests under go test — which
exercises a fixed handful of inputs and never mutates anything. So for those twelve, "we fuzz this"
is false.

Counted from the tree, not remembered:

$ grep -rh '^func Fuzz' --include='*_test.go' . | wc -l
22
$ grep -c '^        - {pkg:' <fuzz-smoke matrix>
10

Absent from the matrix

Package Target Why it matters
internal/storage/s3 FuzzWholeObjectResponse The checksum-verification decision. It decides whether a response is a whole object and therefore whether the SHA-256 gate runs at all. A false positive turns a valid partial read into a corruption error; a false negative silently skips verification
internal/compression FuzzFramedRangeRead Frame-index parsing on the seekable-framing read path
internal/cache FuzzChunkAssembly Reassembly of cached chunks into returned bytes
internal/vfs FuzzXattrEncodingRoundTrip Attribute encode/decode against object metadata
pkg/utils FuzzValidatePath Path validation — the traversal surface
pkg/utils FuzzParseBytes Size-string parsing from operator configuration
internal/distributed/hashring FuzzLookupIsStable Ring stability
internal/awsname FuzzValidateBucketName
internal/awsname FuzzParseStorageURI
internal/awsname FuzzValidateSSEMode
internal/awsname FuzzValidateKMSKeyID
internal/awsname FuzzValidateStorageClass

The first one is the one to be uncomfortable about. Integrity is this project's first priority, and
the function that decides whether the integrity check runs is the function CI does not fuzz.

Why it happened, and the shape of the fix

The matrix is an enumerated gate: a hand-maintained list of targets. A target added to the tree
does not join it, and nothing notices. This is the same failure mode as an enumerated file list — it
checks what its author knew at the time.

So the fix is two parts, and the second is the one that lasts:

  1. Add the twelve to the matrix.
  2. Assert the matrix is complete. internal/config already parses ci.yml (one parser now,
    after Converge the two workflow YAML parsers in internal/config #504). A test that walks the tree for ^func Fuzz, reads the matrix, and fails on a target
    present in one and absent from the other makes step 1 un-regressable. Give it a non-vacuity floor
    so an empty walk cannot pass — the pattern job_timeouts_test.go uses.

Step 2 without step 1 is a red build; do both in one change.

Budget

60s per target is the existing budget and is defensible for a per-PR gate. Twelve more targets at 60s
is twelve more matrix cells, which run in parallel — wall-clock cost is roughly zero, runner-minute
cost is twelve minutes per run. If that is too much, the alternative is a separate scheduled job with
a longer budget, but do not let the budget question block adding the targets: a 60-second fuzz of
FuzzWholeObjectResponse is strictly more than the zero it gets today.

Acceptance criteria

  • All 22 targets are fuzzed by CI
  • A test in internal/config fails when a ^func Fuzz target in the tree is missing from the matrix
  • That test has a non-vacuity floor on the number of targets discovered
  • Mutation-verified: add a throwaway fuzz target, confirm the new test names it, remove it
  • Any counterexample found while adding these is committed to testdata/fuzz/ and fixed

Activity

  1. added
    type: testing
    priority: high
    area: tests
    effort: medium
    area: ci-cd
    on Sep 30, 2026
  2. scttfrdmn commented on Sep 30, 2026

    @scttfrdmn
    OwnerAuthor

    Ran all twelve at 180s each. Two of them had real defects, found in 1 and 6 seconds.

    This is no longer a hypothetical gap. Campaign results, 180s budget per target through
    .github/scripts/fuzz-smoke.sh:

    Target Wall Result
    FuzzWholeObjectResponse 201s clean — 8.5M execs
    FuzzFramedRangeRead 182s clean — 10.4M execs
    FuzzChunkAssembly 189s clean
    FuzzXattrEncodingRoundTrip 182s clean
    FuzzValidatePath 181s clean
    FuzzParseBytes 180s clean
    FuzzLookupIsStable 181s clean
    FuzzValidateBucketName 1s COUNTEREXAMPLE
    FuzzParseStorageURI 180s clean
    FuzzValidateSSEMode 181s clean
    FuzzValidateKMSKeyID 7s COUNTEREXAMPLE
    FuzzValidateStorageClass 181s clean

    Both are fixed in #571, with the counterexamples committed as seed corpus.

    ValidateBucketName("00\x06") accepted a name that makes an unparseable endpoint:
      parse "https://00\x06.s3.us-west-2.amazonaws.com/": net/url: invalid control character in URL
    
    ValidateKMSKeyID("arn:0:kms:0:\x1e:key/00000000-0000-0000-0000-000000000000") = nil
      — and a raw CRLF in the same position also validated clean
    

    What the timings say

    Seven seconds of combined runtime for two real defects. These were not deep, rare states reached
    after millions of executions — a fuzzer hit both almost immediately. That is the signature of code that
    was described as guarded rather than guarded: bucketNameForbiddenBytes enumerated six control bytes
    under a comment claiming the whole category, and ValidateKMSKeyID had no such check at all.

    It also means the counterfactual is stark. Had these two targets been in the matrix at the existing
    60-second budget, CI would have failed on the commit that introduced each defect. The targets were
    already written. The properties were already stated correctly. The only missing piece was a matrix row.

    What it says about the ten clean ones

    Ten targets surviving 180s is genuinely reassuring and should be read as such — but note the asymmetry
    it exposes. The four packages with a committed testdata/fuzz/ corpus are all in CI's matrix; the ones
    absent from it (internal/compression, internal/vfs, pkg/utils,
    internal/distributed/hashring) had no corpus directory at all, because a target that has never
    found anything has nothing to commit. An empty corpus directory looked exactly like a well-tested
    target.

    Bearing on the proposed fix

    This strengthens the case for part 2 over part 1. Adding twelve rows is a one-time correction; the
    completeness test is what stops the thirteenth target from joining the list silently. Recommend keeping
    both in scope and not letting the budget question delay either — 60s would have caught both of these.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci-cdarea: testseffort: mediumpriority: hightype: testing

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions