Resumed -follow-records hits come back with source wordlist

オープン
#441 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@bfs2021 がすでに取り組んでいます。

2026年11月21日 から。

  • #442 @bfs2021 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
go
領域
backend, cli

調査の方向性

Read internal/cli/session.go around restoreTarget and emitFrom, then review the resume tests in internal/cli. Add a hermetic resume test for a -follow-records hit and run go test ./internal/cli. Done means resumed results report records and records_found matches an uninterrupted run; pull request #442 is already open against this issue.

索引モデルが issue の本文から書いたものです。

説明

area: cli bug good first issue severity: low

Summary

When a run with -follow-records is resumed, results that the record-follow step found come back with sources: ["wordlist"] instead of ["records"]. The results file, -stats (records_found), and the source breakdown then disagree with the uninterrupted run.

Where

  • internal/cli/session.go:908 (restoreTarget)
  • internal/cli/session.go:653 (emitFrom)
  • internal/candidates/candidates.go:126 (SourcesOf)

Details

restoreTarget re-emits each saved result as scan.Event{Result: r.Result}. Only -ptr hits get their saved sources back (ptrHit, added in #436). For everything else emitFrom works out the sources again:

case ev.Followed:
	res.Sources = candidates.FromRecords
case !permutation:
	res.Sources = s.cands.SourcesOf(res.Subdomain)

The restored event never has Followed set, and a record-follow target is not in the candidate set, so SourcesOf falls back to FromWordlist. s.foundBy then counts it under wordlist, not records.

Impact

For resumed -follow-records scans, results files and -stats report record-follow hits as wordlist hits. -diff against an uninterrupted run's file can also differ in sources. Low severity: the names themselves are correct.

Steps to reproduce

  1. Run a lab scan with -follow-records and -resume state.json against a zone where a CNAME, MX or NS target is a new in-scope name.
  2. Interrupt it after that name is found, then resume.
  3. In the JSON output, the followed name has "sources": ["wordlist"].

Suggested fix

In restoreTarget, pass the saved r.Sources to emitFrom whenever they are present, as the -ptr branch already does, instead of recomputing them. Add a resume test that covers a -follow-records hit.

Acceptance criteria

  • A resumed run reports record-follow hits with source records, and records_found matches the uninterrupted run
  • A test covers it

Getting started

  • Relevant files: internal/cli/session.go, internal/cli/resume.go, the existing resume tests in internal/cli
  • How to run tests: go test ./internal/cli (tests must stay hermetic: use -simulate, a lab zone or internal/dnstest)
  • Related: #432, #436

Filed by repo-audit/fix-issues at 2fb80e4. Severity: low. Effort: S. audit-key: bug|internal/cli/session.go|restoreTarget-sources

主要言語
Go
スター
1
フォーク
1
平均マージ
8時間 3分
マージ済み PR(30日)
31

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/subenum のほかの issue

TMHSDigital/subenum の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。