Skip to content

Resume integrity checks and passive-source replay have no tests #255

Closed

Description

@TMHSDigital

Summary

The checks that keep -resume correct, and the replay of saved passive-source names, have no test coverage, even with -coverpkg=./....

Where (zero-hit blocks)

  • main_resume.go:254-262: checkInputs refuses when the input has changed
  • main_resume.go:202-211: resumeArgs read, unmarshal and version-mismatch errors
  • main_resume.go:348-356: saving t.Sources
  • main_ct.go:36-38, main_ct.go:58-69: sourceNames replay and the legacy CTFetched fallback (28.6% covered)

Impact

A regression here would let a resume continue from a saved position against a different wordlist, or fetch passive sources again. Either one shifts the candidate list and silently skips names.

Test cases to add (in main_resume_test.go)

  • Wordlist edited between the interrupted run and -resume: exit 2, and an error matching "changed since the interrupted run".
  • Corrupt JSON state file: an error that starts with -resume <path>:.
  • "version": 999: "unsupported state version".
  • Missing state file: "reading -resume state".
  • Interrupt a run with -sources ct,wayback (httptest servers), then resume with the servers changed or failing: the saved names are reused, no HTTP requests are made, and the candidates are identical.
  • Legacy state with ct/ct_fetched and no sources: the CT names are replayed.

Getting started

  • Relevant files: main_resume.go, main_ct.go, main_resume_test.go
  • How to run tests: go test -run Resume .
  • Related docs: docs/DEVELOPER_GUIDE.md

Filed by repo-audit/full-audit at 3f671b2. Severity: medium. Effort: M. audit-key: testing|main_resume.go|checkInputs

Activity

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

    @TMHSDigital
    OwnerAuthor

    Fixed in 9822704: TestE2EResumeRefusesBadState (changed input digest, corrupt JSON, version 999, missing file) and TestE2EResumeReplaysSourceNames (saved -sources names and legacy ct/ct_fetched replayed with zero HTTP requests). The failed-source case is covered by #237's TestSaveResumeStateKeepsFailedSources. Verified with 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

    help wantedseverity: mediumtesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions