{"record":{"id":"2b3b626c0ea76463","repo":"owasp-amass/amass","slug":"target-must-be-a-fqdn-or-ipaddress","errorCode":null,"errorMessage":"target must be a FQDN or IPAddress","messagePattern":"target must be a FQDN or IPAddress","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/plugins/support/fingerprinting.go","lineNumber":33,"sourceCode":"\tet \"github.com/owasp-amass/amass/v5/engine/types\"\n\tamassnet \"github.com/owasp-amass/amass/v5/internal/net\"\n\toam \"github.com/owasp-amass/open-asset-model\"\n\toamdns \"github.com/owasp-amass/open-asset-model/dns\"\n\t\"github.com/owasp-amass/open-asset-model/general\"\n\t\"github.com/owasp-amass/open-asset-model/network\"\n)\n\nfunc JARMFingerprint(sess et.Session, target oam.Asset, portrel *general.PortRelation) (string, error) {\n\tvar ipv6 bool\n\tvar host string\n\n\tif fqdn, ok := target.(*oamdns.FQDN); ok {\n\t\thost = fqdn.Name\n\t} else if ip, ok := target.(*network.IPAddress); ok {\n\t\tipv6 = ip.Address.Is6()\n\t\thost = ip.Address.String()\n\t} else {\n\t\treturn \"\", errors.New(\"target must be a FQDN or IPAddress\")\n\t}\n\n\taddr := host\n\tif ipv6 {\n\t\taddr = \"[\" + addr + \"]\"\n\t}\n\taddr += \":\" + strconv.Itoa(portrel.PortNumber)\n\n\tvar results []string\n\tfor _, probe := range jarm.GetProbes(host, portrel.PortNumber) {\n\t\tsess.NetSem().Acquire()\n\n\t\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\t\tdefer cancel()\n\n\t\tdial := amassnet.NewDialContext(5 * time.Second)\n\t\tc, err := dial(ctx, \"tcp\", addr)\n\t\tsess.NetSem().Release()","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/engine/plugins/support/fingerprinting.go#L15-L51","documentation":"Thrown by support.JARMFingerprint when the target asset is neither an *oamdns.FQDN nor a *network.IPAddress. JARM TLS fingerprinting needs a host string, which is only derivable from those two asset types; anything else makes the function fail with this error. It is an input type-validation error.","triggerScenarios":"JARMFingerprint is called (e.g. from query) with a target asset of any other type — Netblock, Service, ASN, nil, etc. — so both type assertions fail and the else branch returns the error.","commonSituations":"Calling JARMFingerprint directly with a raw string or unsupported asset; pipeline passing domain/service assets without resolving to FQDN or IP first; passing a nil asset.","solutions":["Pass an *oamdns.FQDN or *network.IPAddress asset as the target","Resolve/normalize other asset types (e.g. Service -> port on FQDN/IP) before calling","Add a type check in the caller before invoking JARMFingerprint","Skip JARM fingerprinting for unsupported asset types in the calling plugin"],"exampleFix":"// before\nhash, err := support.JARMFingerprint(session, asset, port)\n// after\nvar target interface{}\nswitch a := asset.(type) {\ncase *oamdns.FQDN, *network.IPAddress:\n\ttarget = a\ndefault:\n\treturn nil // unsupported asset for JARM\n}\nhash, err := support.JARMFingerprint(session, target, port)","handlingStrategy":"validation","validationCode":"switch t := target.(type) {\ncase *oamdns.FQDN, *network.IPAddress:\n\t// ok\ndefault:\n\treturn fmt.Errorf(\"JARM requires FQDN or IPAddress, got %T\", target)\n}","typeGuard":"func jarmCapable(target asset.Asset) bool {\n\tswitch target.(type) {\n\tcase *oamdns.FQDN, *network.IPAddress:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"hash, err := support.JARMFingerprint(session, target, port)\nif err != nil {\n\tif strings.Contains(err.Error(), \"target must be a FQDN or IPAddress\") {\n\t\treturn nil // unsupported asset type; skip JARM\n\t}\n\treturn err\n}","preventionTips":["Validate asset type before calling JARMFingerprint","Only fingerprint FQDN/IP assets discovered by the pipeline","Resolve Service assets to host FQDN/IP first","Unit-test JARM calls with representative asset types"],"tags":["go","type-mismatch","jarm","fingerprinting"],"backgroundTag":"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"}