{"record":{"id":"06feeaf654568cb2","repo":"owasp-amass/amass","slug":"s-is-not-a-valid-ip","errorCode":null,"errorMessage":"%s is not a valid IP","messagePattern":"(.+?) is not a valid IP","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scope.go","lineNumber":377,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc (p *ParseIPs) appendIPs(addrs []net.IP) error {\n\tfor _, addr := range addrs {\n\t\t*p = append(*p, addr)\n\t}\n\treturn nil\n}\n\nfunc (p *ParseIPs) parseRange(s string) error {\n\ttwoIPs := strings.Split(s, \"-\")\n\n\t// If s is not a range, try parsing it as a single IP\n\tif twoIPs[0] == s {\n\t\tip := net.ParseIP(s)\n\t\tif ip == nil {\n\t\t\treturn fmt.Errorf(\"%s is not a valid IP\", s)\n\t\t}\n\t\treturn p.appendIPs([]net.IP{ip})\n\t}\n\tstart := net.ParseIP(twoIPs[0])\n\tend := net.ParseIP(twoIPs[1])\n\tif end == nil {\n\t\tnum, err := strconv.Atoi(twoIPs[1])\n\t\tif err == nil {\n\t\t\tend = net.ParseIP(twoIPs[0])\n\t\t\tend[len(end)-1] = byte(num)\n\t\t}\n\t}\n\tif start == nil || end == nil {\n\t\treturn fmt.Errorf(\"%s is not a valid IP range\", s)\n\t}\n\n\tips := amassnet.RangeHosts(start, end)\n\tif len(ips) == 0 {","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/scope.go#L359-L395","documentation":"parseRange splits a scope token on '-'; if the token contains no dash it is treated as a single IP. When net.ParseIP cannot parse it, this error is returned. It means a non-range token in the IP scope is not a valid IP address.","triggerScenarios":"Calling Set/populate with a single token (no '-') that net.ParseIP rejects: '10.0.0' (missing octet), '999.1.1.1', a hostname, or an empty/whitespace token.","commonSituations":"Typos in scope files, CIDR notation fed to a parser that expects 'a.b.c.d' or 'a.b.c.d-e.f.g.h' (CIDR like 10.0.0.0/24 is not handled here), or hostnames mixed into IP lists.","solutions":["Fix the token to be a full valid IP literal (all four octets / full IPv6)","If you intended a subnet, express it as an explicit range like 10.0.0.0-10.0.0.255 instead of CIDR","Remove hostnames from the IP scope and place them in the domain scope"],"exampleFix":"// before\nscope.Set(\"10.0.0/24\")\n// after\nscope.Set(\"10.0.0.0-10.0.0.255\")","handlingStrategy":"validation","validationCode":"func checkSingleIP(s string) error {\n\tif !strings.Contains(s, \"-\") && net.ParseIP(s) == nil {\n\t\treturn fmt.Errorf(\"%q is not a valid single IP\", s)\n\t}\n\treturn nil\n}","typeGuard":"func isSingleIP(s string) bool { return !strings.Contains(s, \"-\") && net.ParseIP(s) != nil }","tryCatchPattern":"if err := scope.Set(tok); err != nil {\n\tif strings.Contains(err.Error(), \"is not a valid IP\") {\n\t\tlog.Printf(\"skipping invalid single IP %q\", tok)\n\t}\n}","preventionTips":["Use full four-octet IPv4 or full IPv6 literals","Do not pass CIDR notation to Set; expand to ranges first","Strip whitespace and stray characters from config entries"],"tags":["config","ip-address","validation","amass"],"backgroundTag":"invalid-config-value","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"}