{"record":{"id":"38ba8fe58ff42656","repo":"projectdiscovery/nuclei","slug":"dialers-not-initialized-for-s-38ba8f","errorCode":null,"errorMessage":"dialers not initialized for %s","messagePattern":"dialers not initialized for (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/protocols/javascript/js.go","lineNumber":727,"sourceCode":"\t\tcallback(event)\n\t} else if request.options.Interactsh != nil {\n\t\tevent = &output.InternalWrappedEvent{InternalEvent: data, UsesInteractsh: true}\n\t\trequest.options.Interactsh.RequestEvent(interactshURLs, &interactsh.RequestData{\n\t\t\tMakeResultFunc: request.MakeResultEvent,\n\t\t\tEvent:          event,\n\t\t\tOperators:      request.CompiledOperators,\n\t\t\tMatchFunc:      request.Match,\n\t\t\tExtractFunc:    request.Extract,\n\t\t})\n\t}\n\treturn nil\n}\n\n// generateEventData generates event data for the request\nfunc (request *Request) generateEventData(input *contextargs.Context, values map[string]interface{}, matched string) map[string]interface{} {\n\tdialers := protocolstate.GetDialersWithId(request.options.Options.ExecutionId)\n\tif dialers == nil {\n\t\tpanic(fmt.Sprintf(\"dialers not initialized for %s\", request.options.Options.ExecutionId))\n\t}\n\n\tdata := make(map[string]interface{})\n\tmaps.Copy(data, values)\n\tdata[\"type\"] = request.Type().String()\n\tdata[\"request-pre-condition\"] = beautifyJavascript(request.PreCondition)\n\tdata[\"request\"] = beautifyJavascript(request.Code)\n\tdata[\"host\"] = input.MetaInput.Input\n\tdata[\"matched\"] = matched\n\tdata[\"template-path\"] = request.options.TemplatePath\n\tdata[\"template-id\"] = request.options.TemplateID\n\tdata[\"template-info\"] = request.options.TemplateInfo\n\tif request.StopAtFirstMatch || request.options.StopAtFirstMatch {\n\t\tdata[\"stop-at-first-match\"] = true\n\t}\n\t// add ip address to data\n\tif input.MetaInput.CustomIP != \"\" {\n\t\tdata[\"ip\"] = input.MetaInput.CustomIP","sourceCodeStart":709,"sourceCodeEnd":745,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/javascript/js.go#L709-L745","documentation":"The JavaScript protocol's event-data builder panicked because dialers are missing for the template execution's id. generateEventData looks up protocolstate.GetDialersWithId(request.options.Options.ExecutionId) and panics on nil before assembling the per-request event map — so this fires at result/event generation time, i.e., only after a JS request actually ran, not at template compile time.","triggerScenarios":"Executing a code-protocol template in a process where protocolstate.Init never registered dialers for the active ExecutionId; an execution id present in ExecutorOptions but different from the one used at Init; dialers deleted mid-run (policy rebuild deletes then re-inits, so a race window exists if Init is skipped).","commonSituations":"lib/nuclei integrations and custom harnesses that drive pkg/protocols/javascript directly; late-binding execution ids cloned from options after Init ran under a previous id.","solutions":["Run protocolstate.Init(options) with the exact ExecutionId before executing any code-protocol template.","Route scans through the official runner so event generation always happens post-Init.","Guard the SDK boundary with protocolstate.ShouldInit(id).","When cloning ExecutorOptions per run, either reuse the initialized id or re-Init for the new id."],"exampleFix":"// before\n// SDK executes a code template; on first match/extract generateEventData panics\n\n// after\nif protocolstate.ShouldInit(opts.ExecutionId) {\n    if err := protocolstate.Init(opts); err != nil { return err }\n}\nresults, err := jsEngine.ExecuteWithResults(ctx, template, ...)","handlingStrategy":"validation","validationCode":"if protocolstate.ShouldInit(opts.ExecutionId) {\n    if err := protocolstate.Init(opts); err != nil { return err }\n}\nresults, err := jsEngine.ExecuteWithResults(ctx, ...)","typeGuard":null,"tryCatchPattern":"// pre-validate; recovering this panic mid-event would corrupt result emission.","preventionTips":["Init before code-protocol execution.","When cloning ExecutorOptions per run, re-Init for new execution ids.","Smoke-run one JS template after setup to catch init gaps early."],"tags":["panic","javascript","dialers","events","sdk"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}