Skip to content

Resume state digests word files the run ignores; a missing one blocks saving #480

Backlog

Description

@TMHSDigital

Summary

The resume state hashes every -w, -recursive-w and -permute-w path, including config-file or SUBENUM_* defaults that the run deliberately does not read. If one of those files is missing, saving the resume state fails. If one changed, -resume is refused.

Where

  • internal/cli/resume.go:430 (inputDigests hashes slices.Concat(f.wordlists.paths, f.deepWords.paths, f.permuteWords.paths) unconditionally)
  • internal/cli/resume.go:546-549 (saving resume state: ...; return false)
  • internal/cli/resume.go:447-455 (checkInputs)
  • internal/cli/wordlist.go:89, :146, :157 (when the run skips each list)

Impact

A user whose config sets a recursive-w or permute-w default, and who later moves or edits that file, loses resume for unrelated runs. Ctrl+C or -max-duration prints "saving resume state: open ...: no such file" and writes no state, or -resume is refused because a file the run never read changed.

Steps to reproduce

SUBENUM_RECURSIVE_W=/missing.txt subenum -simulate-zone lab1 -rate 5 -t 10 -max-duration 2s -w wl.txt -state st.json lab1.example (no -recursive) ends with Error: saving resume state: open ...missing.txt and writes no st.json. Without the variable it prints "Saved resume state to st.json".

Suggested fix

Digest only what the run reads: skip deepWords unless recursive with depth >= 2, permuteWords unless a permute pass runs, and wordlists under -hosts/-permute-only. Share one helper with prepareWordlist, prepareDeepWordlist and preparePermuteWords so the guards cannot drift.

Acceptance criteria

  • The repro saves its state.
  • A test changes an unused -permute-w file between runs and resume still works.

Getting started

  • Relevant files: internal/cli/resume.go, internal/cli/wordlist.go
  • How to run tests: go test ./internal/cli -run Resume

Filed by repo-audit/full-audit at a45b999. Severity: low. Effort: S. audit-key: bug|internal/cli/resume.go|inputDigests

Activity

  1. added
    bug
    good first issue
    area: cli
    severity: low
    on Nov 29, 2026
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: clibuggood first issueseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions