{"record":{"id":"2484693eea7db733","repo":"projectdiscovery/subfinder","slug":"hostip-flag-must-be-used-with-removewildcard-optio","errorCode":null,"errorMessage":"hostip flag must be used with RemoveWildcard option","messagePattern":"hostip flag must be used with RemoveWildcard option","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/validate.go","lineNumber":40,"sourceCode":"\t\treturn errors.New(\"no input list provided\")\n\t}\n\n\t// Both verbose and silent flags were used\n\tif options.Verbose && options.Silent {\n\t\treturn errors.New(\"both verbose and silent mode specified\")\n\t}\n\n\t// Validate threads and options\n\tif options.Threads == 0 {\n\t\treturn errors.New(\"threads cannot be zero\")\n\t}\n\tif options.Timeout == 0 {\n\t\treturn errors.New(\"timeout cannot be zero\")\n\t}\n\n\t// Always remove wildcard with hostip\n\tif options.HostIP && !options.RemoveWildcard {\n\t\treturn errors.New(\"hostip flag must be used with RemoveWildcard option\")\n\t}\n\n\t// The per-source results limit cannot be negative.\n\tif options.MaxResults < 0 {\n\t\treturn fmt.Errorf(\"max-results cannot be negative\")\n\t}\n\n\t// The response body size limit cannot be negative.\n\tif options.MaxResponseBodySize < 0 {\n\t\treturn fmt.Errorf(\"response-size-read cannot be negative\")\n\t}\n\n\tif options.Match != nil {\n\t\toptions.matchRegexes = make([]*regexp.Regexp, len(options.Match))\n\t\tvar err error\n\t\tfor i, re := range options.Match {\n\t\t\tif options.matchRegexes[i], err = regexp.Compile(stripRegexString(re)); err != nil {\n\t\t\t\treturn errors.New(\"invalid value for match regex option\")","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/projectdiscovery/subfinder/blob/7a0b91f0fac01b62c65328bd771a3560ae611d6a/pkg/runner/validate.go#L22-L58","documentation":"Dependency check in Options.validateOptions: the -hostip flag (resolve and append IPs to results) was enabled without -removeWildcard. Host-IP output relies on wildcard removal to strip DNS wildcard synthesized hosts, so the combination is rejected as a misconfiguration.","triggerScenarios":"Thrown at pkg/runner/validate.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add -rw/-removeWildcard alongside -hostip when you want IP output","Drop the -hostip flag if wildcard removal is not desired"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a0b91f0fac01b62c65328bd771a3560ae611d6a","analyzedAt":"2026-09-06T23:52:02.109Z","contentChangedAt":"2026-09-06T23:52:02.109Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}