Skip to content

Wildcard detection silently passes when probe lookups fail, so wildcard zones flood results #47

Closed

Description

@TMHSDigital

Why it matters

Wildcard filtering is a core trust feature ("it tells you how much to trust the result"). Today, if the wildcard probes time out or SERVFAIL, subenum concludes "no wildcard" and scans with no fingerprint and no warning. Under a real wildcard every candidate then "resolves", producing a results list that is entirely noise. In recursive mode the failed check is cached permanently for that branch.

Evidence

  • internal/dns/resolver.go:289-290 discards both probe errors:
    r1, _, _ := ResolveTypes(ctx, resolver, probe1, timeout, types)
    r2, _, _ := ResolveTypes(ctx, resolver, probe2, timeout, types)
    and only returns an error on context cancellation.
  • internal/scan/runner.go:129-137 caches the per-branch result regardless.
  • The err != nil branch at internal/scan/runner.go:511 ("wildcard check failed") is effectively dead: it can only fire on cancellation.
  • Repro (hermetic test DNS): *.dev.example.com wildcard with its probe queries dropped, Depth 2, 31-entry wordlist → 32 results reported instead of 1.

Suggested approach

  • Classify probe outcomes; treat the check as conclusive only if every probe ended Found or NXDOMAIN/NODATA.
  • Retry probes up to cfg.Attempts.
  • On an inconclusive check: at the root, abort with a clear error (overridable with -force); in recursion, skip expansion of that branch with a notice. Never cache an inconclusive result.
  • Tests: probe timeout and probe SERVFAIL at the root and at a recursion level.

Done when

A failed or inconclusive wildcard check is never reported as "no wildcard", and both new test cases pass.

Activity

  1. added
    bug
    priority: high
    area: dns
    area: scan
    on Oct 4, 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: dnsarea: scanbugpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions