Repository navigation
Description
Summary
The run summary counts takeover candidates, internal addresses and found names from the main pass only. Hits from the -permute and -ptr passes are in the results file but missing from -stats, subenum report, and the Action's takeovers, internal and found outputs. Under -permute-only, takeover_candidates is always 0.
Where
internal/report/report.go:126,:128(Target:t.Takeover = st.Takeover,t.Internal = st.Internal)internal/report/permutation.go:30(Permutation: adds queries and verdict, notStats.Takeover/Internal)internal/cli/summary.go:69(ptrSummary: same)internal/cli/session.go:882(-permute-only: the main pass is a syntheticEventDone)internal/cli/runreport.go:141-157(Found column and takeover section)action.yml:290,:294-295(found,takeovers,internaloutputs)
Details
Each pass counts its own takeover hints and non-public addresses (internal/scan/runner.go:853-864), but only the main pass's counts reach TargetSummary. PermutationSummary has no takeover field. docs/output.md:101 and docs/schemas/stats.v1.json:56 define takeover_candidates as "Results with a takeover hint", meaning all results. Downstream, markdownReport prints the takeover list only if takeovers > 0, and the Action sums .targets[].takeover_candidates.
The same drift affects found: the Action computes (.found // 0) + (.permutation.found // 0) and markdownReport adds t.Permutation.Found, and neither was updated for ptr_found when -ptr landed (#436).
Impact
A dangling CNAME found only by the permutation or PTR pass is in -o and -sarif, but -stats reports 0, the Action's takeovers output is 0, and the job summary leaves out the "Takeover candidates" section. Workflows that gate or alert on takeovers stay silent. found and the report's Found column undercount by the PTR hits.
Steps to reproduce
- Lab zone where only a permutation such as
dev-api(from seedapi) has a CNAME to an unclaimed provider host. subenum -permute-only -seeds seeds.jsonl -type A,CNAME -stats run.json -o jsonl:r.jsonl ...r.jsonlhas atakeover_candidate;run.jsonhas none;subenum report -stats run.json -results r.jsonlprints no takeover section.
Suggested fix
In report.Permutation, under p.Final != nil, add final.Stats.Takeover and final.Stats.Internal to t (and add the fields to PermutationSummary). Do the same in ptrSummary under p.pass.done. For found, compute a per-target results total once in Go and have both action.yml and markdownReport read it instead of summing pass fields by hand; short term, add ptr_found to both formulas.
Acceptance criteria
- A takeover found only by the permutation pass is counted in
takeover_candidates,subenum reportand the Action output. - Same for a
-ptrpass hit and for-permute-only. -
foundin the Action and the report's Found column includeptr_found. -
docs/schemas/stats.v1.jsonanddocs/output.mdmatch.
Getting started
- Relevant files:
internal/report/permutation.go,internal/cli/summary.go,internal/cli/runreport.go,action.yml - How to run tests:
go test ./...(tests must be hermetic:-simulateor the built-in lab server)
Filed by repo-audit/full-audit at a45b999. Severity: medium. Effort: S. audit-key: bug|internal/report/report.go|Target
Activity
TMHSDigital commentedon Nov 29, 2026
Fixed in dc71593: report.Permutation and ptrSummary now add each pass's Stats.Takeover and Stats.Internal to the target's takeover_candidates and internal_addresses (the TUI shares report.Permutation), and the report's Found column and the Action's found output include ptr_found. The schema and output.md already define takeover_candidates as all results, so they did not change. New TestTargetSummaryCountsEveryPass (fails without the fix: 1/1 instead of 7/9, Found 3 instead of 6). Gate (gofmt, vet, golangci-lint v2.15.0, full suite) passes.