{"record":{"id":"0a6b91e28a0b0587","repo":"owasp-amass/amass","slug":"alterations-wordlist-file-is-not-an-array","errorCode":null,"errorMessage":"alterations wordlist_file is not an array","messagePattern":"alterations wordlist_file is not an array","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":88,"sourceCode":"\talterations, ok := alterationsRaw.(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"alterations is not a map[string]interface{}\")\n\t}\n\n\tenabled, ok := alterations[\"enabled\"].(bool)\n\tif !ok {\n\t\treturn fmt.Errorf(\"alterations enabled is not a bool\")\n\t}\n\n\tc.Alterations = enabled\n\tif !c.Alterations {\n\t\treturn nil\n\t}\n\n\tif wordlistPathRaw, ok := alterations[\"wordlists\"]; ok {\n\t\twordlistPaths, ok := wordlistPathRaw.([]interface{})\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"alterations 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(\"alterations 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 alterations wordlist_file setting: %s: %v\", absPath, err)\n\t\t\t}\n","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L70-L106","documentation":"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.","triggerScenarios":"A config where alterations.wordlists is a single string or mapping instead of a list, e.g. wordlists: alt-words.txt without list syntax.","commonSituations":"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.","solutions":["Express wordlists as a YAML list: alterations:\\n  wordlists:\\n    - alt-words.txt","Quote and dash every path entry","Convert []string to []interface{} when building Options in Go","Remove the wordlists key to skip alterations wordlist loading (it is optional)"],"exampleFix":"# before\nalterations:\n  wordlists: alt-words.txt\n\n# after\nalterations:\n  wordlists:\n    - alt-words.txt","handlingStrategy":"validation","validationCode":"func validateAltWordlists(alterations map[string]interface{}) error {\n\tv, ok := alterations[\"wordlists\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\tif _, ok := v.([]interface{}); !ok {\n\t\treturn fmt.Errorf(\"alterations.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(), \"alterations wordlist_file is not an array\") {\n\t\t// convert wordlists to a dash list in the config and reload\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["Use the dash list syntax for alterations wordlists even with one path","Copy the structure from the project's example config","Convert typed Go slices to []interface{} when constructing options in code","Lint the YAML to catch scalars where lists are expected"],"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"}