{"record":{"id":"a3157d5ca69b1ad9","repo":"projectdiscovery/nuclei","slug":"only-one-target-url-is-supported-in-s-input-mode","errorCode":null,"errorMessage":"only one target URL is supported in %s input mode","messagePattern":"only one target URL is supported in (.+?) input mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/input/provider/interface.go","lineNumber":120,"sourceCode":"\t\t\tparts := strings.SplitN(v, \"=\", 2)\n\t\t\tif len(parts) == 2 {\n\t\t\t\textraVars[parts[0]] = parts[1]\n\t\t\t}\n\t\t}\n\t}\n\n\t// check if input provider is supported\n\tif strings.EqualFold(opts.Options.InputFileMode, \"list\") {\n\t\t// create a new list input provider\n\t\treturn list.New(&list.Options{\n\t\t\tOptions:          opts.Options,\n\t\t\tNotFoundCallback: opts.NotFoundCallback,\n\t\t})\n\t} else if len(opts.Options.Targets) > 0 &&\n\t\t(strings.EqualFold(opts.Options.InputFileMode, \"openapi\") || strings.EqualFold(opts.Options.InputFileMode, \"swagger\")) {\n\n\t\tif len(opts.Options.Targets) > 1 {\n\t\t\treturn nil, fmt.Errorf(\"only one target URL is supported in %s input mode\", opts.Options.InputFileMode)\n\t\t}\n\n\t\ttarget := opts.Options.Targets[0]\n\t\tif strings.HasPrefix(target, \"http://\") || strings.HasPrefix(target, \"https://\") {\n\t\t\tvar downloader formats.SpecDownloader\n\t\t\tvar tempFile string\n\t\t\tvar err error\n\n\t\t\t// Get HttpClient from protocolstate if available\n\t\t\tvar httpClient *retryablehttp.Client\n\t\t\tif opts.Options.ExecutionId != \"\" {\n\t\t\t\tdialers := protocolstate.GetDialersWithId(opts.Options.ExecutionId)\n\t\t\t\tif dialers != nil {\n\t\t\t\t\thttpClient = dialers.DefaultHTTPClient\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch strings.ToLower(opts.Options.InputFileMode) {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/input/provider/interface.go#L102-L138","documentation":"provider.NewInputProvider rejects configurations where more than one target is supplied together with `-input-file-mode openapi` or `swagger` (pkg/input/provider/interface.go). Remote spec download supports exactly one spec URL per run because the single downloaded file becomes TargetsFilePath for the whole scan.","triggerScenarios":"`nuclei -im openapi -u url1 -u url2`; multiple -target flags with openapi/swagger mode; multiple URL targets piped via stdin while -im openapi is set (both funnel into Options.Targets).","commonSituations":"Batch-scanning several APIs with one command; muscle memory from list mode where many -u flags are normal; automation scripts looping a URL list into a single nuclei invocation.","solutions":["Run nuclei once per spec URL (loop the command in your shell or script)","Download each spec locally and scan the files with list mode: nuclei -l specs.txt (auto-detect per file)","For mixed endpoints, aggregate all URLs in a plain file and use default list mode instead of openapi/swagger mode"],"exampleFix":"# before\nnuclei -im openapi -u https://a.com/openapi.json -u https://b.com/openapi.json\n\n# after\nfor u in https://a.com/openapi.json https://b.com/openapi.json; do\n  nuclei -im openapi -u \"$u\"\ndone","handlingStrategy":"validation","validationCode":"if (strings.EqualFold(mode, \"openapi\") || strings.EqualFold(mode, \"swagger\")) && len(targets) > 1 {\n    return fmt.Errorf(\"%s mode accepts one spec URL; pass the rest as separate runs\", mode)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"only one target URL is supported\") {\n    // split the target list and invoke one scan per URL\n}","preventionTips":["Loop one URL per nuclei invocation in openapi/swagger mode","Use list mode with downloaded local spec files for batch scans","Assert len(targets)==1 in wrapper scripts before spawning nuclei"],"tags":["cli","input-mode","openapi","swagger","targets"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}