{"record":{"id":"4ffc1c89b6cde18d","repo":"owasp-amass/amass","slug":"invalid-type-for-priority-in-default-transform-val","errorCode":null,"errorMessage":"invalid type for priority in default_transform_values","messagePattern":"invalid type for priority in default_transform_values","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/transform.go","lineNumber":93,"sourceCode":"\t\tdtvMap, ok := dtv.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"invalid type for default_transform_values\")\n\t\t}\n\t\t// Convert the map to the Transformation struct\n\t\tif ttl, ok := dtvMap[\"ttl\"].(int); ok {\n\t\t\tc.DefaultTransformations.TTL = ttl\n\t\t} else if !ok && dtvMap[\"ttl\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for ttl in default_transform_values\")\n\t\t}\n\t\tif confidence, ok := dtvMap[\"confidence\"].(int); ok {\n\t\t\tc.DefaultTransformations.Confidence = confidence\n\t\t} else if !ok && dtvMap[\"confidence\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for confidence in default_transform_values\")\n\t\t}\n\t\tif priority, ok := dtvMap[\"priority\"].(int); ok {\n\t\t\tc.DefaultTransformations.Priority = priority\n\t\t} else if !ok && dtvMap[\"priority\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for priority in default_transform_values\")\n\t\t}\n\n\t}\n\treturn nil\n}\n\n// Split splits the key into 'From' and 'To' components, expecting a \"->\" delimiter.\n// Requires a non-nil Transformation pointer and a valid key format. Example: FQDN->IPaddress.\nfunc (t *Transformation) Split(key string) error {\n\tif t.From != \"\" && t.To != \"\" {\n\t\tt.From = strings.ToLower(t.From)\n\t\tt.To = strings.ToLower(t.To)\n\t\treturn nil // Already split\n\t}\n\t// Split the key into 'From' and 'To' components, expecting a \"->\" delimiter.\n\tparts := strings.Split(key, \"->\")\n\tif len(parts) != 2 {\n\t\treturn fmt.Errorf(\"invalid key delimiter: %s\", key)","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/transform.go#L75-L111","documentation":"The 'confidence' field inside default_transform_values is present and non-nil but is not an int (e.g. a quoted string \"80\" or a float from YAML). The type assertion dtvMap[\"confidence\"].(int) fails and the guard rejects the config, since confidence must be an integer value for Transformation settings.","triggerScenarios":"YAML like 'priority: \"1\"' or 'priority: high' inside default_transform_values — quoted numbers or words fail the .(int) assertion.","commonSituations":"Quoting numbers in hand-edited YAML, or using named priority levels ('high'/'low') unsupported by the parser.","solutions":["Set priority as an unquoted integer, e.g. priority: 1","Replace named levels with their integer equivalents","Run the config through a YAML validator to confirm int typing"],"exampleFix":"// before\ndefault_transform_values:\n  priority: \"1\"\n// after\ndefault_transform_values:\n  priority: 1","handlingStrategy":"type-guard","validationCode":"if v, ok := dtv[\"priority\"]; ok && v != nil {\n\tif _, isInt := v.(int); !isInt {\n\t\treturn errors.New(\"priority in default_transform_values must be an integer\")\n\t}\n}","typeGuard":"func isInt(v interface{}) bool { _, ok := v.(int); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(path); err != nil && strings.Contains(err.Error(), \"invalid type for priority\") {\n\treturn fmt.Errorf(\"priority must be an integer in %s\", path)\n}","preventionTips":["Use numeric priorities, not named levels","Keep the value unquoted in YAML","Validate generated configs against a schema before loading"],"tags":["config","yaml","type-error","priority","amass"],"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-14T00:17:10.932Z"}