{"record":{"id":"2ac7cf5887170d5f","repo":"owasp-amass/amass","slug":"invalid-start-port-v","errorCode":null,"errorMessage":"invalid start port: %v","messagePattern":"invalid start port: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scope.go","lineNumber":140,"sourceCode":"\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported port type: %T\", p)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc convertPortRangeToSlice(portRange string) ([]int, error) {\n\tvar ports []int\n\n\tparts := strings.Split(portRange, \"-\")\n\tif len(parts) != 2 {\n\t\treturn nil, fmt.Errorf(\"invalid port range format\")\n\t}\n\n\tstart, err := strconv.Atoi(parts[0])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid start port: %v\", err)\n\t}\n\n\tend, err := strconv.Atoi(parts[1])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid end port: %v\", err)\n\t}\n\n\tfor i := start; i <= end; i++ {\n\t\tports = append(ports, i)\n\t}\n\n\treturn ports, nil\n}\n\n// returns true is ports match default ports (80,443), otherwise return false\nfunc portCheck(ports []int) bool {\n\tdefaultPorts := []int{80, 443}\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/scope.go#L122-L158","documentation":"convertPortRangeToSlice could not parse the start (lower bound) of a port range such as \"80-443\": strconv.Atoi on the substring before the '-' failed because it is not a valid integer (letters, empty, or out-of-range digits). The format itself already passed the two-part split check, so only the numeric value is at fault.","triggerScenarios":"A range like 'http-90', ' 80-90' (leading space), or 'o80-90' is passed; strconv.Atoi on parts[0] fails.","commonSituations":"Whitespace inside range strings from hand-edited YAML, alphabetic typos, full-width digits, or BOM characters at the start of the value.","solutions":["Correct the start value to a plain integer, e.g. '80-90'","Trim spaces and invisible characters from the range string","Verify digits are ASCII (not full-width Unicode)"],"exampleFix":"// before\nports: [\" 80-90\"]\n// after\nports: [\"80-90\"]","handlingStrategy":"validation","validationCode":"parts := strings.Split(s, \"-\"); if len(parts) == 2 { if _, err := strconv.Atoi(parts[0]); err != nil { return err } }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the start side is a pure integer","Trim leading whitespace","Beware full-width digits and BOMs from copy-paste","Lint config numeric fields"],"tags":["config","ports","parsing"],"backgroundTag":"invalid-argument-format","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"}