owasp-amass/amass · critical

config seed and scope are not initialized

Error message

config seed and scope are not initialized

What it means

loadSeedandScopeSettings requires that either a Seed or a Scope is configured. If Seed is nil or empty and Scope is also nil, there is no target universe to work from, so the error is returned. If Scope exists, it is populated and used as the Seed.

Source

Thrown at config/scope.go:22

package config

import (
	"fmt"
	"net"
	"regexp"
	"strconv"
	"strings"

	"github.com/caffix/stringset"
	amassnet "github.com/owasp-amass/amass/v5/internal/net"
	"github.com/owasp-amass/amass/v5/internal/net/dns"
)

func (c *Config) loadSeedandScopeSettings() error {
	if c.Seed == nil || c.Seed.isScopeEmpty(false) {
		if c.Scope == nil {
			return fmt.Errorf("config seed and scope are not initialized")
		} else {
			if err := c.Scope.populate(); err != nil {
				return err
			}
			c.Seed = c.Scope
			return nil
		}
	} else if err := c.Seed.populate(); err != nil {
		return err
	}

	if c.Scope == nil || !c.Scope.isScopeEmpty(true) {
		if err := c.Seed.populate(); err != nil {
			return err
		}
		c.Scope = c.Seed
		c.Scope.Ports = []int{80, 443}
		return nil

View on GitHub (pinned to 79299dce87)

Solutions

  1. Set a Scope on the config (e.g. cfg.Scope = amass.NewScope() and add domains/ASNs) before loading settings
  2. Set a Seed with target domains so the check passes
  3. Add a scope/seed section to the config file if loading from YAML/JSON

Example fix

// before
cfg := amass.NewConfig()
cfg.LoadSettings("amass.ini") // Seed and Scope nil
// after
cfg := amass.NewConfig()
cfg.Scope = amass.NewScope()
cfg.Scope.AddDomain("example.com")
cfg.LoadSettings("amass.ini")
Defensive patterns

Strategy: validation

Validate before calling

if cfg.Seed == nil && cfg.Scope == nil { return errors.New("config requires Seed or Scope before LoadSettings") }

Type guard

func hasTarget(c *Config) bool { return c.Seed != nil || c.Scope != nil }

Try / catch

if err := cfg.LoadSettings(path); err != nil {
    if strings.Contains(err.Error(), "seed and scope") { cfg.Scope = amass.NewScope() /* retry */ }
    return err
}

Prevention

When it happens

Trigger: LoadSettings is called on a Config where neither Seed nor Scope was set (both nil), or Seed exists but isScopeEmpty(false) is true while Scope is nil.

Common situations: Creating a Config programmatically and forgetting to call NewScope/NewSeed or set domains; loading an empty/minimal config file with no scope section; older configs missing the seed field after a version upgrade.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/ca971500a5b3bed4. Report an issue: GitHub.