Skip to content

Resume skips names when a passive source failed first and succeeds on resume #237

Closed

Description

@TMHSDigital

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 with fetched set are saved in t.Sources
  • main_ct.go:35-51: a source with no saved names is fetched again on resume
  • main_session.go:635-643: source names are appended to entries in -sources order
  • main_session.go:669: pass.resumeFrom = saved.RootDone indexes into that combined list
  • main_session.go:630: entryDigests covers 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

  1. Run -sources ct,wayback with crt.sh failing (an httptest server returning 502) and Wayback returning W names.
  2. Interrupt while the Wayback names are being tested, so RootDone is greater than the wordlist length.
  3. Run -resume with crt.sh now returning C names. The candidate list becomes wordlist + C + W, and the scan restarts at the old RootDone.

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 with golangci-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

  1. added
    bug
    help wanted
    severity: medium
    on Nov 14, 2026
  2. TMHSDigital commented on Nov 14, 2026

    @TMHSDigital
    OwnerAuthor

    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.

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

    bughelp wantedseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions