owasp-amass/amass · error
bruteforce wordlist_file is not an array
Error message
bruteforce wordlist_file is not an array
What it means
In loadBruteForceSettings, the optional "wordlists" key of the bruteforce map is asserted to be []interface{} so each entry can be read as a path string. The assertion failed, meaning "wordlists" is a scalar or map rather than a list. The library throws this because it expects an array of wordlist file paths.
Source
Thrown at config/brute.go:37
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")
}
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 bruteforce wordlist_file setting: %s: %v", absPath, err)
}
View on GitHub (pinned to 79299dce87)
Solutions
- Wrap the path in a YAML list: bruteforce:\n wordlists:\n - words.txt
- If multiple paths, ensure every entry uses a leading dash
- In Go code, convert []string to []interface{} before assigning to Options
- Remove the wordlists key entirely to skip loading (it is optional)
Example fix
# before
bruteforce:
wordlists: /usr/share/words.txt
# after
bruteforce:
wordlists:
- /usr/share/words.txt Defensive patterns
Strategy: validation
Validate before calling
func validateBruteWordlists(bruteforce map[string]interface{}) error {
v, ok := bruteforce["wordlists"]
if !ok {
return nil
}
if _, ok := v.([]interface{}); !ok {
return fmt.Errorf("bruteforce.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(), "wordlist_file is not an array") {
// wrap the single path in a list in the config and reload
}
log.Fatal(err)
} Prevention
- Always use the dash list syntax for wordlists, even for a single path
- Compare against the example config's wordlists block
- Convert typed slices to []interface{} when building options programmatically
- Validate the parsed config against an expected schema before loading
When it happens
Trigger: Config where bruteforce.wordlists is set to a single string instead of a list, e.g. wordlists: words.txt (missing the dash/list syntax), or a map of wordlists.
Common situations: YAML mistake writing wordlists: /path/to/list.txt instead of wordlists:\n - /path/to/list.txt; users migrating from tools that accept a single path string; programmatic config passing []string without conversion to []interface{}.
Related errors
- alterations wordlist_file is not an array
- failed to parse active setting, value is not a boolean
- bruteforce is not a map[string]interface{}
- bruteforce enabled is not a bool
- bruteforce wordlist_file item is not a string
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/1ca2718717826923.
Report an issue: GitHub.