owasp-amass/amass · error

alterations wordlist_file is not an array

Error message

alterations wordlist_file is not an array

What it means

In loadAlterationSettings, the optional "wordlists" key of the alterations map is asserted to be []interface{} so each entry can be read as a wordlist path string. The assertion failed, meaning "wordlists" is a scalar or map rather than a list. The library expects an array of paths to load into Config.AltWordlist.

Source

Thrown at config/brute.go:88

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

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

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

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

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

			absPath, err := c.AbsPathFromConfigDir(wordlistPath)
			if err != nil {
				return fmt.Errorf("failed to get absolute path for wordlist file: %w", err)
			}

			wordlist, err := GetListFromFile(absPath)
			if err != nil {
				return fmt.Errorf("unable to load the file in the alterations wordlist_file setting: %s: %v", absPath, err)
			}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Express wordlists as a YAML list: alterations:\n wordlists:\n - alt-words.txt
  2. Quote and dash every path entry
  3. Convert []string to []interface{} when building Options in Go
  4. Remove the wordlists key to skip alterations wordlist loading (it is optional)

Example fix

# before
alterations:
  wordlists: alt-words.txt

# after
alterations:
  wordlists:
    - alt-words.txt
Defensive patterns

Strategy: validation

Validate before calling

func validateAltWordlists(alterations map[string]interface{}) error {
	v, ok := alterations["wordlists"]
	if !ok {
		return nil
	}
	if _, ok := v.([]interface{}); !ok {
		return fmt.Errorf("alterations.wordlists must be a YAML list of paths, got %T", v)
	}
	return nil
}

Type guard

func isStringSlice(v interface{}) bool {
	s, ok := v.([]interface{})
	if !ok { return false }
	for _, e := range s { if _, ok := e.(string); !ok { return false } }
	return true
}

Try / catch

if err := cfg.LoadSettings(); err != nil {
	if strings.Contains(err.Error(), "alterations wordlist_file is not an array") {
		// convert wordlists to a dash list in the config and reload
	}
	log.Fatal(err)
}

Prevention

When it happens

Trigger: A config where alterations.wordlists is a single string or mapping instead of a list, e.g. wordlists: alt-words.txt without list syntax.

Common situations: Missing YAML dash for list items; copying bruteforce-style single-path syntax from docs of other tools; programmatic config passing a string instead of a slice.

Related errors


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