{"record":{"id":"3d9aa86bd047de5c","repo":"owasp-amass/amass","slug":"bruteforce-wordlist-file-item-is-not-a-string","errorCode":null,"errorMessage":"bruteforce wordlist_file item is not a string","messagePattern":"bruteforce wordlist_file item is not a string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":43,"sourceCode":"\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\n\t\t\tc.Wordlist = append(c.Wordlist, wordlist...)\n\t\t}\n\t}\n\n\tc.Wordlist = stringset.Deduplicate(c.Wordlist)\n\treturn nil","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L25-L61","documentation":"In loadBruteForceSettings, after asserting \"wordlists\" is a list, each element is asserted to be a string path via `wordlistPathRaw.(string)`. The assertion failed because at least one list item is a number, bool, nested map, or list instead of a string. The library needs plain string paths to resolve and read each wordlist file.","triggerScenarios":"A bruteforce.wordlists array containing a non-string element, e.g. wordlists:\\n  - 42, an unquoted path that YAML parses as something else, or a nested mapping/list entry.","commonSituations":"Unquoted paths starting with special characters (e.g. * or yes/no) that YAML coerces to other types; a copy-paste error leaving an object where a path belongs; comment or indentation artifacts producing nested blocks.","solutions":["Quote every wordlist path in the list: wordlists:\\n  - \"/path/to/list.txt\"","Inspect the list and remove or fix any non-string entries","Check for paths that YAML auto-converts (numbers, booleans, glob chars) and quote them","Add a pre-parse check that every element of the array is a string"],"exampleFix":"# before\nbruteforce:\n  wordlists:\n    - 42\n\n# after\nbruteforce:\n  wordlists:\n    - \"/usr/share/words.txt\"","handlingStrategy":"validation","validationCode":"func validateWordlistItems(wordlists []interface{}) error {\n\tfor i, e := range wordlists {\n\t\tif _, ok := e.(string); !ok {\n\t\t\treturn fmt.Errorf(\"wordlists[%d] must be a quoted string path, got %T\", i, e)\n\t\t}\n\t}\n\treturn nil\n}","typeGuard":"func isString(v interface{}) bool { _, ok := v.(string); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(); err != nil {\n\tif strings.Contains(err.Error(), \"wordlist_file item is not a string\") {\n\t\t// quote every path entry in the config and reload\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["Quote all wordlist paths, especially ones with numbers, globs, or YAML-special words","Check that no list item accidentally becomes a nested block from bad indentation","Lint the YAML before deploying config changes","Validate each wordlists element is a string before calling the loader"],"tags":["go","config","type-assertion","string"],"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"}