owasp-amass/amass · error

alterations is not a map[string]interface{}

Error message

alterations is not a map[string]interface{}

What it means

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.

Source

Thrown at config/brute.go:72

			}

			c.Wordlist = append(c.Wordlist, wordlist...)
		}
	}

	c.Wordlist = stringset.Deduplicate(c.Wordlist)
	return nil
}

func (c *Config) loadAlterationSettings(cfg *Config) error {
	alterationsRaw, ok := c.Options["alterations"]
	if !ok {
		return nil
	}

	alterations, ok := alterationsRaw.(map[string]interface{})
	if !ok {
		return fmt.Errorf("alterations is not a map[string]interface{}")
	}

	enabled, ok := alterations["enabled"].(bool)
	if !ok {
		return fmt.Errorf("alterations enabled is not a bool")
	}

	c.Alterations = enabled
	if !c.Alterations {
		return nil
	}

	if wordlistPathRaw, ok := alterations["wordlists"]; ok {
		wordlistPaths, ok := wordlistPathRaw.([]interface{})
		if !ok {
			return fmt.Errorf("alterations wordlist_file is not an array")
		}

View on GitHub (pinned to 79299dce87)

Solutions

  1. Make alterations a mapping: alterations:\n enabled: true
  2. Fix YAML indentation so enabled/wordlists are nested under alterations
  3. In Go, assign map[string]interface{}{"enabled": true} to Options["alterations"]
  4. Remove the "alterations" key if the feature is not needed (absence is accepted)

Example fix

# before
alterations: enabled

# after
alterations:
  enabled: true
Defensive patterns

Strategy: type-guard

Validate before calling

func validateAlterationsSection(options map[string]interface{}) error {
	v, ok := options["alterations"]
	if !ok {
		return nil
	}
	if _, ok := v.(map[string]interface{}); !ok {
		return fmt.Errorf("alterations must be a mapping, got %T", v)
	}
	return nil
}

Type guard

func isStringMap(v interface{}) bool { _, ok := v.(map[string]interface{}); return ok }

Try / catch

if err := cfg.LoadSettings(); err != nil {
	if strings.Contains(err.Error(), "alterations is not a map") {
		// restore the alterations block structure in the config and reload
	}
	log.Fatal(err)
}

Prevention

When it happens

Trigger: A config where c.Options["alterations"] exists but is not a mapping, e.g. alterations: true, alterations: "enabled", or a list.

Common situations: 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.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/d48c21779da3fd46. Report an issue: GitHub.