Repository navigation
Description
Summary
The near-miss wildcard revalidation loop added for #48 is never executed by any test. isWildcardAnswer is 25% covered and the probe loop shows zero hits.
Where
internal/scan/runner.go:265-282(isWildcardAnswer; loop at 270-281 unreached)internal/scan/runner_test.go:637-689(TestRunRotatingPoolWildcardFiltered, the only test on this path)
Details
In the existing test all 8 rotating IPs are already in the fingerprint after preflight probing, so every answer is covered and the loop at line 274 never runs. The loop is also short-circuited whenever cfg.resolveHook != nil || cfg.Simulate (line 267), so none of the hook-based tests can reach it.
Impact
A rotating-pool wildcard with more IPs than preflight caught (the real #48 scenario) could pass unfiltered, and the fingerprint-growth logic can break silently.
Suggested test cases
- Rotating wildcard with 64 IPs returning 2 records per answer: at least 95% of wildcard names filtered AND
done.Fingerprintgrew beyond the preflight size - A real name sharing one record with the fingerprint (CNAME to the wildcard target plus its own A): reported, not filtered, with exactly
nearMissProbesextra queries charged (checkStats.Queries) - Near-miss probe with the context cancelled mid-probe: returns false (keeps the result) and the scan still ends with one
EventDone - Let the hook path exercise the loop (hook answers random-label probes) or add a table test calling
isWildcardAnswerdirectly with a stub resolver
Acceptance criteria
-
isWildcardAnswerfully covered - Tests run against the in-repo
dnsserver, no live DNS
Getting started
- Relevant files:
internal/scan/runner.go,internal/scan/runner_test.go,internal/dnsserver - How to run tests:
go test -cover ./internal/scan/ - Related docs: README "Wildcard handling"
Related: #48
Filed by repo-audit/full-audit at 3139c44. Severity: medium. Effort: M. audit-key: testing|internal/scan/runner.go|wildcard near-miss
Activity
TMHSDigital commentedon Nov 9, 2026
Fixed in e5e38c3.
internal/scan/nearmiss_test.gocallsisWildcardAnswerdirectly against the in-repo DNS server (no live DNS), with every name answering like a rotating pool that preflight only partly saw. Cases: covered answer (no probes); real name sharing nothing (no probes); near miss the pool explains (1 probe, fingerprint grows, filtered); real name sharing one record (exactlynearMissProbesprobes, kept); cancelled context (kept); simulated run (never probes). Probe counts come from the server's query counter.go tool covershowsisWildcardAnswerat 100%. Passes under-race; full suite and lint pass. The engine-level 64-address rotation scenario from the suggestions was not added; the table test covers the same logic deterministically.