{"record":{"id":"4be93808ae29baeb","repo":"owasp-amass/amass","slug":"bruteforce-is-not-a-map-string-interface","errorCode":null,"errorMessage":"bruteforce is not a map[string]interface{}","messagePattern":"bruteforce is not a map\\[string\\]interface(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":21,"sourceCode":"// SPDX-License-Identifier: Apache-2.0\n\npackage config\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/caffix/stringset\"\n)\n\nfunc (c *Config) loadBruteForceSettings(cfg *Config) error {\n\tbruteforceRaw, ok := c.Options[\"bruteforce\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\n\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","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L3-L39","documentation":"Config.loadBruteForceSettings retrieves the \"bruteforce\" key from the options map and asserts it is a map[string]interface{} before reading sub-settings like enabled and wordlists. The assertion failed, meaning \"bruteforce\" holds a scalar, array, or other non-map value. The library throws this because the bruteforce section cannot be structured as expected.","triggerScenarios":"Loading a config where c.Options[\"bruteforce\"] exists but is not a map, e.g. bruteforce: true, bruteforce: \"on\", or a list in the parsed options.","commonSituations":"Config file where the bruteforce section was flattened into a scalar; YAML indentation mistake collapsing a map into a string; programmatic config construction passing a struct or string instead of map[string]interface{}.","solutions":["Make the bruteforce key a mapping in the config: bruteforce:\\n  enabled: true","Check indentation in YAML so bruteforce is a nested block, not a scalar","If setting Options in Go code, use map[string]interface{}{\"enabled\": true, ...}","Remove the \"bruteforce\" key if brute-forcing is not needed (absence is tolerated)"],"exampleFix":"# before\nbruteforce: true\n\n# after\nbruteforce:\n  enabled: true","handlingStrategy":"type-guard","validationCode":"func validateBruteForceSection(options map[string]interface{}) error {\n\tv, ok := options[\"bruteforce\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\tif _, ok := v.(map[string]interface{}); !ok {\n\t\treturn fmt.Errorf(\"bruteforce must be a mapping, got %T\", v)\n\t}\n\treturn nil\n}","typeGuard":"func isStringMap(v interface{}) bool { _, ok := v.(map[string]interface{}); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(); err != nil {\n\tif strings.Contains(err.Error(), \"bruteforce is not a map\") {\n\t\t// reload or fix the bruteforce section in the config\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["Keep bruteforce settings indented as a block under the bruteforce key","Copy settings from the project's example config, not from scratch","Inspect parsed options with a debug dump (e.g. %#v) when configs misbehave","Run a lint/schema validation pass on the config at startup"],"tags":["go","config","type-assertion","map"],"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-14T05:17:10.506Z"}