{"record":{"id":"1ca2718717826923","repo":"owasp-amass/amass","slug":"bruteforce-wordlist-file-is-not-an-array","errorCode":null,"errorMessage":"bruteforce wordlist_file is not an array","messagePattern":"bruteforce wordlist_file is not an array","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":37,"sourceCode":"\tbruteforce, ok := bruteforceRaw.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"bruteforce is not a map[string]interface{}\")\n\t}\n\n\tenabled, ok := bruteforce[\"enabled\"].(bool)\n\tif !ok {\n\t\treturn fmt.Errorf(\"bruteforce enabled is not a bool\")\n\t}\n\n\tc.BruteForcing = enabled\n\tif !c.BruteForcing {\n\t\treturn nil\n\t}\n\n\tif wordlistPathRaw, ok := bruteforce[\"wordlists\"]; ok {\n\t\twordlistPaths, ok := wordlistPathRaw.([]interface{})\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"bruteforce wordlist_file is not an array\")\n\t\t}\n\n\t\tfor _, wordlistPathRaw := range wordlistPaths {\n\t\t\twordlistPath, ok := wordlistPathRaw.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"bruteforce wordlist_file item is not a string\")\n\t\t\t}\n\n\t\t\tabsPath, err := c.AbsPathFromConfigDir(wordlistPath)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to get absolute path for wordlist file: %w\", err)\n\t\t\t}\n\n\t\t\twordlist, err := GetListFromFile(absPath)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to load the file in the bruteforce wordlist_file setting: %s: %v\", absPath, err)\n\t\t\t}\n","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L19-L55","documentation":"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.","triggerScenarios":"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.","commonSituations":"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{}.","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)"],"exampleFix":"# before\nbruteforce:\n  wordlists: /usr/share/words.txt\n\n# after\nbruteforce:\n  wordlists:\n    - /usr/share/words.txt","handlingStrategy":"validation","validationCode":"func validateBruteWordlists(bruteforce map[string]interface{}) error {\n\tv, ok := bruteforce[\"wordlists\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\tif _, ok := v.([]interface{}); !ok {\n\t\treturn fmt.Errorf(\"bruteforce.wordlists must be a YAML list of paths, got %T\", v)\n\t}\n\treturn nil\n}","typeGuard":"func isStringSlice(v interface{}) bool {\n\ts, ok := v.([]interface{})\n\tif !ok { return false }\n\tfor _, e := range s { if _, ok := e.(string); !ok { return false } }\n\treturn true\n}","tryCatchPattern":"if err := cfg.LoadSettings(); err != nil {\n\tif strings.Contains(err.Error(), \"wordlist_file is not an array\") {\n\t\t// wrap the single path in a list in the config and reload\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["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"],"tags":["go","config","type-assertion","array"],"backgroundTag":"config-type-mismatch","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}