Description
Summary
A resumed scan can silently skip names when a passive source failed during the first run but succeeds on resume. The newly fetched names shift every later candidate position, while RootDone still points into the old list.
Where
main_resume.go:350-357: only sources withfetchedset are saved int.Sourcesmain_ct.go:35-51: a source with no saved names is fetched again on resumemain_session.go:635-643: source names are appended toentriesin-sourcesordermain_session.go:669:pass.resumeFrom = saved.RootDoneindexes into that combined listmain_session.go:630:entryDigestscovers only the wordlist entries, so the shift is not detected
Details
RootDone is an index into wordlist + source names + AXFR names. A failed source is not recorded. On resume it is fetched again, and if it now succeeds, its names are inserted before the saved names of later sources (and before any AXFR names). Every position after that point moves, but the scan restarts at the old index.
Impact
Up to C names (where C is how many names the recovered source returns) are never tested, and others are tested twice. Nothing counts as skipped, so the verdict can still read complete. crt.sh often returns 5xx, so this is a realistic sequence for -sources ct,wayback monitoring runs.
Steps to reproduce
- Run
-sources ct,waybackwith crt.sh failing (an httptest server returning 502) and Wayback returning W names. - Interrupt while the Wayback names are being tested, so
RootDoneis greater than the wordlist length. - Run
-resumewith crt.sh now returning C names. The candidate list becomes wordlist + C + W, and the scan restarts at the oldRootDone.
Suggested fix
Either:
- save failed sources in the state with an empty name list and an error marker, and do not fetch them again on resume; or
- store a digest of the full combined entry list and refuse to resume when it differs, with the same "changed since the interrupted run" error the wordlist check uses.
Acceptance criteria
- Interrupting with a failed source, then resuming with it working, tests every name exactly once (or refuses to resume).
- Regression test using httptest servers for ct and wayback.
Getting started
- Relevant files:
main_resume.go,main_ct.go,main_session.go - How to run tests:
go test ./...(lint withgolangci-lint run ./...) - Related docs:
docs/DEVELOPER_GUIDE.md
Filed by repo-audit/full-audit at 3f671b2. Severity: medium. Effort: M. audit-key: bug|main_resume.go|sourceNames
Activity
TMHSDigital commentedon Nov 14, 2026
Fixed in f03626f: the resume state now saves a failed passive source with an empty name list (savedSources), so -resume replays it instead of refetching and the candidate positions stay aligned. Verified with TestSaveResumeStateKeepsFailedSources, go test ./... and golangci-lint.