{"record":{"id":"8b95c9ec517f3eab","repo":"owasp-amass/amass","slug":"alterations-enabled-is-not-a-bool","errorCode":null,"errorMessage":"alterations enabled is not a bool","messagePattern":"alterations enabled is not a bool","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":77,"sourceCode":"\n\tc.Wordlist = stringset.Deduplicate(c.Wordlist)\n\treturn nil\n}\n\nfunc (c *Config) loadAlterationSettings(cfg *Config) error {\n\talterationsRaw, ok := c.Options[\"alterations\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\n\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}","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L59-L95","documentation":"In loadAlterationSettings, once the alterations map is decoded, the \"enabled\" sub-key is asserted to be a bool via `alterations[\"enabled\"].(bool)`. The assertion failed because the value is a string, number, or nil. The library requires a strict boolean to set Config.Alterations.","triggerScenarios":"A config where alterations is a map but alterations.enabled is not a bool, e.g. enabled: \"true\", enabled: 1, or enabled: (null/empty).","commonSituations":"Quoted booleans from hand-edited configs; yes/on values from other tools' conventions; an empty key left behind after deleting a value.","solutions":["Set alterations.enabled to a plain boolean: alterations:\\n  enabled: true","Replace string/number/yes-no values with true or false","Delete the key if you want it omitted rather than malformed","Add a config schema validation step that verifies enabled is bool before load"],"exampleFix":"# before\nalterations:\n  enabled: 1\n\n# after\nalterations:\n  enabled: true","handlingStrategy":"type-guard","validationCode":"func validateAltEnabled(alterations map[string]interface{}) error {\n\tv, ok := alterations[\"enabled\"]\n\tif !ok {\n\t\treturn fmt.Errorf(\"alterations.enabled is required\")\n\t}\n\tif _, ok := v.(bool); !ok {\n\t\treturn fmt.Errorf(\"alterations.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(), \"alterations enabled is not a bool\") {\n\t\t// set enabled to unquoted true/false and reload\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["Write enabled as a bare true/false token, unquoted","Avoid yes/no/1/0 conventions from other tools","Remove leftover empty keys after editing the config","Validate the config file automatically in CI before distribution"],"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"}