Skip to content

FP-7: fuzzers, fuzz-all and CI fuzzing for every target - #312

Merged
randomizedcoder merged 3 commits into
mainfrom
sec/fp7-fuzzers
Nov 23, 2026
Merged

randomizedcoder merged 3 commits into
mainfrom
sec/fp7-fuzzers

Conversation

@randomizedcoder

@randomizedcoder randomizedcoder commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

FP-7 (D4) from docs/security-hardening/focused-implementation-plan.md.

  • FuzzDockerProjection: Docker inspect JSON → new pure project() (split from (*Index).inspect, no behaviour change); invariants: valid UTF-8, ≤ MaxLen, no control runes, inode ≠ 0.
  • FuzzRowFromProto (dest_s3parquet): envelope → rowFromProto → Parquet write → read back, byte-for-byte.
  • FuzzClean: adds idempotence and fast-path identity checks.
  • Each fuzzer shares a table (name, category P/N/B/C, description, expected) with a table-driven unit test; the rows seed the corpus.
  • fuzz-all (dev shell, nix/scripts/fuzz-all.bash): discovers every Fuzz* via go test -list under the flavor tags (50 today), fails below a minimum count, runs all, lists crashers.
  • .github/workflows/fuzz.yml: fuzz-pr 10 s/target on PRs; fuzz-nightly 2 min/target daily + workflow_dispatch; crashers and logs uploaded on failure.
  • Bug found by the first full run: /ip/vrf/show/NAME for a non-VRF name returned 500; now 404. Input committed as a seed plus a table row.
  • Docker API bodies capped per endpoint (/version 64 KiB, list 32 MiB, inspect 1 MiB); drainClose bounded to 64 KiB. Bug: an /events line over 1 MiB made the unbounded drain block the refresh goroutine on the endless stream, so metadata silently stopped updating.
  • Fixes go test ./... on main: FP-6: bounded S3 queue, disk spill, string policy #308 put pkg/strpolicy in xtcpnl's closure; genl clones: devlink, vdpa, fou, mptcp, tipc read-only clones + iproute2 findings #309's godevlink/gotipc/govdpa closure tests lacked it.
  • Local full run: 50 targets at 10 s in 588 s, 0 failures after the fix.
  • Checks: go test ./..., tagged pkg/xtcp, lint-baseline, golangci (3 tiers), gofmt, go-vet, nix-fmt, no-write-encoders, flavor-tags.
  • TODO in the plan doc: F0.5 rows as FuzzRowFromProto seeds.

🤖 Generated with Claude Code

randomizedcoder and others added 3 commits November 22, 2026 22:16
…closures

xtcpnl's congestion-name decoder imports strpolicy (#308); the three closure
tests from #309 merged alongside it without that entry, so go test ./... fails
on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FuzzDockerProjection: inspect JSON through a new pure project(), split out
  of (*Index).inspect with no behaviour change; TestProject and
  TestDockerProjectionJSON share its seed table.
- FuzzRowFromProto (dest_s3parquet): an envelope through rowFromProto,
  Parquet write and read back; TestRowFromProtoRoundTrip shares its seeds.
- FuzzClean: idempotence and fast-path identity; TestCleanProperties.
- fuzz-all (nix/scripts/fuzz-all.bash, dev shell): discovers every target
  with go test -list under the flavor tags, guards a minimum count, runs
  all, lists crashers.
- .github/workflows/fuzz.yml: fuzz-pr at 10 s per target, fuzz-nightly at
  2 min, crashers uploaded on failure.
- goiphttp: vrf show NAME for a name that is no VRF is a 404, not a 500
  (found by the first full run; input kept as a seed and a table row).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- getJSON takes a limit: /version 64 KiB, /containers/json 32 MiB, inspect
  1 MiB; over it is errBodyTooLarge (container skipped, or the re-list fails
  and the old index stays). Decoding keeps json.Decoder's semantics.
- drainClose discards at most 64 KiB, then closes. An /events line over the
  scanner's 1 MiB ended the scan, and the unbounded drain then blocked the
  refresh goroutine on the endless stream.
- Table tests: TestGetJSONLimit, TestInspectBodyCap, TestDrainCloseBounded,
  TestEventsOversizedLineReturns (fails in 20 s with the old drain).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@randomizedcoder
randomizedcoder merged commit 4dc4c9e into main Nov 23, 2026
3 checks passed
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