Skip to content

MCP permutation pass skips the MaxPermutations cap the CLI applies #484

Backlog

Description

@TMHSDigital

Summary

The MCP server's permutation pass builds its candidates with subenum.Permutations(seeds, nil), which has no limit. The CLI path is capped at MaxPermutations (1,000,000) since #400, and the pass can only test what is left of the budget anyway.

Where

  • internal/cli/mcp_report.go:181 (permutationPass)
  • pkg/subenum/subenum.go:489 (Permutations -> permute.Generate(..., 0))
  • internal/permute/permute.go:41, internal/candidates/candidates.go:235 (the CLI's capped path)

Impact

Up to 93 candidates per seed, and the seeds are every result of the scan, zone-transfer and CT names included. An MCP operator who raises -max-queries, scanning a zone with about 100k names, gets roughly 9.3M strings (around 1 GB) built and normalized, although only the remaining budget is tested.

Suggested fix

In permutationPass, use the capped generator (permute.GenerateSet(seeds, permute.Words, tested, limit)) with limit = min(candidates.MaxPermutations, budget), and report the cap in the pass's reason.

Acceptance criteria

  • A test with many seeds and a small budget asserts the number of candidates built is bounded by the budget.

Getting started

  • Relevant files: internal/cli/mcp_report.go, internal/permute/permute.go
  • How to run tests: go test ./internal/cli -run MCP

Filed by repo-audit/full-audit at a45b999. Severity: low. Effort: S. audit-key: performance|internal/cli/mcp_report.go|permutationPass

Activity

  1. added
    good first issue
    performance
    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

    good first issueperformanceseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions