{"record":{"id":"c0b65ba24b362a29","repo":"owasp-amass/amass","slug":"bruteforce-enabled-is-not-a-bool","errorCode":null,"errorMessage":"bruteforce enabled is not a bool","messagePattern":"bruteforce enabled is not a bool","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":26,"sourceCode":"\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\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}","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L8-L44","documentation":"Inside loadBruteForceSettings, after successfully decoding the bruteforce map, the \"enabled\" sub-key is asserted to be a bool with `bruteforce[\"enabled\"].(bool)`. The assertion failed because enabled holds a string, number, or nil. The library requires a strict boolean to set Config.BruteForcing.","triggerScenarios":"A config where bruteforce is a map but its \"enabled\" value is not a bool, e.g. bruteforce:\\n  enabled: \"yes\" or enabled: 1 or enabled: (empty/null).","commonSituations":"Users copying settings from other tools that accept yes/no/1/0; quoted \"true\" values; YAML keys left empty (null) which decodes to nil.","solutions":["Set enabled to a plain unquoted boolean: bruteforce:\\n  enabled: true","Replace yes/no/1/0 style values with true/false","Remove the empty or null enabled key and re-add it as true or false","Pre-validate the parsed options map with a reflection-based bool check before loading"],"exampleFix":"# before\nbruteforce:\n  enabled: \"yes\"\n\n# after\nbruteforce:\n  enabled: true","handlingStrategy":"type-guard","validationCode":"func validateBruteEnabled(bruteforce map[string]interface{}) error {\n\tv, ok := bruteforce[\"enabled\"]\n\tif !ok {\n\t\treturn fmt.Errorf(\"bruteforce.enabled is required\")\n\t}\n\tif _, ok := v.(bool); !ok {\n\t\treturn fmt.Errorf(\"bruteforce.enabled must be true/false, got %T\", v)\n\t}\n\treturn nil\n}","typeGuard":"func isBool(v interface{}) bool { _, ok := v.(bool); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(); err != nil {\n\tif strings.Contains(err.Error(), \"bruteforce enabled is not a bool\") {\n\t\t// rewrite enabled as unquoted true/false and reload\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["Always write enabled: true or enabled: false, never \"true\", yes, 1, or on","Leave no empty (null) enabled keys in the config","Test the config after edits by running the tool once before production use","Normalize configs from other tools through a converter that emits strict booleans"],"tags":["go","config","type-assertion","boolean"],"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"}