owasp-amass/amass · error

bruteforce enabled is not a bool

Error message

bruteforce enabled is not a bool

What it means

Inside loadBruteForceSettings, after successfully decoding the bruteforce map, the "enabled" sub-key is asserted to be a bool with `bruteforce["enabled"].(bool)`. The assertion failed because enabled holds a string, number, or nil. The library requires a strict boolean to set Config.BruteForcing.

Source

Thrown at config/brute.go:26

	"fmt"

	"github.com/caffix/stringset"
)

func (c *Config) loadBruteForceSettings(cfg *Config) error {
	bruteforceRaw, ok := c.Options["bruteforce"]
	if !ok {
		return nil
	}

	bruteforce, ok := bruteforceRaw.(map[string]interface{})
	if !ok {
		return fmt.Errorf("bruteforce is not a map[string]interface{}")
	}

	enabled, ok := bruteforce["enabled"].(bool)
	if !ok {
		return fmt.Errorf("bruteforce enabled is not a bool")
	}

	c.BruteForcing = enabled
	if !c.BruteForcing {
		return nil
	}

	if wordlistPathRaw, ok := bruteforce["wordlists"]; ok {
		wordlistPaths, ok := wordlistPathRaw.([]interface{})
		if !ok {
			return fmt.Errorf("bruteforce wordlist_file is not an array")
		}

		for _, wordlistPathRaw := range wordlistPaths {
			wordlistPath, ok := wordlistPathRaw.(string)
			if !ok {
				return fmt.Errorf("bruteforce wordlist_file item is not a string")
			}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Set enabled to a plain unquoted boolean: bruteforce:\n enabled: true
  2. Replace yes/no/1/0 style values with true/false
  3. Remove the empty or null enabled key and re-add it as true or false
  4. Pre-validate the parsed options map with a reflection-based bool check before loading

Example fix

# before
bruteforce:
  enabled: "yes"

# after
bruteforce:
  enabled: true
Defensive patterns

Strategy: type-guard

Validate before calling

func validateBruteEnabled(bruteforce map[string]interface{}) error {
	v, ok := bruteforce["enabled"]
	if !ok {
		return fmt.Errorf("bruteforce.enabled is required")
	}
	if _, ok := v.(bool); !ok {
		return fmt.Errorf("bruteforce.enabled must be true/false, got %T", v)
	}
	return nil
}

Type guard

func isBool(v interface{}) bool { _, ok := v.(bool); return ok }

Try / catch

if err := cfg.LoadSettings(); err != nil {
	if strings.Contains(err.Error(), "bruteforce enabled is not a bool") {
		// rewrite enabled as unquoted true/false and reload
	}
	log.Fatal(err)
}

Prevention

When it happens

Trigger: A config where bruteforce is a map but its "enabled" value is not a bool, e.g. bruteforce:\n enabled: "yes" or enabled: 1 or enabled: (empty/null).

Common situations: Users copying settings from other tools that accept yes/no/1/0; quoted "true" values; YAML keys left empty (null) which decodes to nil.

Related errors


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