{"record":{"id":"b58c1729c0cd26ca","repo":"projectdiscovery/nuclei","slug":"dialers-with-executionid-executionid-not-found-b58c17","errorCode":null,"errorMessage":"dialers with executionId {executionId} not found","messagePattern":"dialers with executionId (.+?) not found","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/js/libs/ldap/ldap.go","lineNumber":95,"sourceCode":"\tc.cfg = utils.GetStructTypeSafe[Config](c.nj, call.Arguments, 2, Config{})\n\tc.Realm = realm\n\tc.BaseDN = fmt.Sprintf(\"dc=%s\", strings.Join(strings.Split(realm, \".\"), \",dc=\"))\n\n\t// validate arguments\n\tc.nj.Require(ldapUrl != \"\", \"ldap url cannot be empty\")\n\tc.nj.Require(realm != \"\", \"realm cannot be empty\")\n\n\tu, err := url.Parse(ldapUrl)\n\tc.nj.HandleError(err, \"invalid ldap url supported schemas are ldap://, ldaps://, ldapi://, and cldap://\")\n\tif u.Scheme == \"\" {\n\t\t// default to ldap\n\t\tu.Scheme = \"ldap\"\n\t}\n\n\texecutionId := c.nj.ExecutionId()\n\tdialers := protocolstate.GetDialersWithId(executionId)\n\tif dialers == nil {\n\t\tpanic(\"dialers with executionId \" + executionId + \" not found\")\n\t}\n\n\tdialCtx := c.nj.Context()\n\tvar conn net.Conn\n\tif u.Scheme == \"ldapi\" {\n\t\t// the ldapi unix domain socket is not covered by the IP-based network\n\t\t// policy directly, so gate it on whether loopback access is permitted\n\t\t// (blocked when local network access is restricted via -lna).\n\t\tconst ldapiPolicyHost = \"127.0.0.1\"\n\n\t\tc.nj.Require(protocolstate.IsHostAllowed(executionId, ldapiPolicyHost), protocolstate.ErrHostDenied.Msgf(ldapiPolicyHost).Error())\n\t\tif u.Path == \"\" || u.Path == \"/\" {\n\t\t\tu.Path = \"/var/run/slapd/ldapi\"\n\t\t}\n\t\tconn, err = dialers.Fastdialer.Dial(dialCtx, \"unix\", u.Path)\n\t\tc.nj.HandleError(err, \"failed to connect to ldap server\")\n\t} else {\n\t\tswitch u.Scheme {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/ldap/ldap.go#L77-L113","documentation":"The LDAP library constructor panicked because dialers were not registered for the current execution id. ldap.go fetchers executionId via c.nj.ExecutionId() and looks up protocolstate.GetDialersWithId; a nil result panics before any connection is attempted (including the ldapi:// Unix-socket path). This is a JS runtime initialization defect, not an LDAP protocol error.","triggerScenarios":"A code-protocol template using the LDAP client (nuclei's goja LDAP bindings) inside a process where protocolstate.Init never registered dialers for that ExecutionId; ctx executionId not matching the id used at Init; running the JS LDAP lib in a custom harness without the standard runner.","commonSituations":"lib/nuclei embedders exercising LDAP templates; third-party runners that build the goja runtime themselves; versions where dialers moved from global to per-execution-id registration.","solutions":["Ensure protocolstate.Init(options) with the matching Options.ExecutionId runs before any template executes.","Drive templates through the official nuclei runner, which owns the Init lifecycle.","Pre-check protocolstate.ShouldInit(executionId) in SDK code before instantiating engines.","Keep the executionId injected into the JS context identical to the one used at Init."],"exampleFix":"// before\nerr := engine.Execute(template, target) // LDAP template -> panic\n\n// after\nif protocolstate.ShouldInit(opts.ExecutionId) {\n    if err := protocolstate.Init(opts); err != nil { return err }\n}\nerr := engine.Execute(template, target)","handlingStrategy":"validation","validationCode":"if protocolstate.ShouldInit(execID) {\n    if err := protocolstate.Init(opts); err != nil { return err }\n}\n// now the LDAP lib's internal GetDialersWithId lookup succeeds","typeGuard":null,"tryCatchPattern":"// no catch: panics in the JS runtime abort the template run; fix initialization order.","preventionTips":["Init dialers before executing LDAP code templates.","Validate the ldapi/ldap URL schema yourself before invoking the client — but the dialer panic is purely init-order."],"tags":["panic","ldap","javascript","dialers","sdk"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}