{"record":{"id":"d48c21779da3fd46","repo":"owasp-amass/amass","slug":"alterations-is-not-a-map-string-interface","errorCode":null,"errorMessage":"alterations is not a map[string]interface{}","messagePattern":"alterations is not a map\\[string\\]interface(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":72,"sourceCode":"\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\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","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L54-L90","documentation":"Config.loadAlterationSettings reads the \"alterations\" key from the options map and asserts it is a map[string]interface{} before reading its sub-settings. The assertion failed because \"alterations\" holds a scalar or other non-map value. The library throws this because the alterations section cannot be decoded as an options group.","triggerScenarios":"A config where c.Options[\"alterations\"] exists but is not a mapping, e.g. alterations: true, alterations: \"enabled\", or a list.","commonSituations":"YAML indentation error collapsing the alterations block into a scalar; hand-editing that replaced the map with a boolean; programmatic config building with the wrong Go type.","solutions":["Make alterations a mapping: alterations:\\n  enabled: true","Fix YAML indentation so enabled/wordlists are nested under alterations","In Go, assign map[string]interface{}{\"enabled\": true} to Options[\"alterations\"]","Remove the \"alterations\" key if the feature is not needed (absence is accepted)"],"exampleFix":"# before\nalterations: enabled\n\n# after\nalterations:\n  enabled: true","handlingStrategy":"type-guard","validationCode":"func validateAlterationsSection(options map[string]interface{}) error {\n\tv, ok := options[\"alterations\"]\n\tif !ok {\n\t\treturn nil\n\t}\n\tif _, ok := v.(map[string]interface{}); !ok {\n\t\treturn fmt.Errorf(\"alterations 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(), \"alterations is not a map\") {\n\t\t// restore the alterations block structure in the config and reload\n\t}\n\tlog.Fatal(err)\n}","preventionTips":["Keep enabled and wordlists nested under alterations with correct indentation","Diff your config against the upstream example after every manual edit","Dump the parsed options map to confirm section structure","Run schema validation on the config before loading"],"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"}