{"record":{"id":"5daea1324e0cdf4c","repo":"projectdiscovery/nuclei","slug":"dialers-not-initialized-for-s-5daea1","errorCode":null,"errorMessage":"dialers not initialized for %s","messagePattern":"dialers not initialized for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/js/libs/smb/smbghost.go","lineNumber":43,"sourceCode":"// ```javascript\n// const smb = require('nuclei/smb');\n// const isSMBGhost = smb.DetectSMBGhost('acme.com', 445);\n// ```\nfunc (c *SMBClient) DetectSMBGhost(ctx context.Context, host string, port int) (bool, error) {\n\texecutionId := ctx.Value(\"executionId\").(string)\n\treturn memoizeddetectSMBGhost(ctx, executionId, host, port)\n}\n\n// @memo\nfunc detectSMBGhost(ctx context.Context, executionId string, host string, port int) (bool, error) {\n\tif !protocolstate.IsHostAllowed(executionId, host) {\n\t\t// host is not valid according to network policy\n\t\treturn false, protocolstate.ErrHostDenied.Msgf(host)\n\t}\n\taddr := net.JoinHostPort(host, strconv.Itoa(port))\n\tdialer := protocolstate.GetDialersWithId(executionId)\n\tif dialer == nil {\n\t\treturn false, fmt.Errorf(\"dialers not initialized for %s\", executionId)\n\t}\n\tconn, err := dialer.Fastdialer.Dial(ctx, \"tcp\", addr)\n\tif err != nil {\n\t\treturn false, err\n\n\t}\n\tdefer func() {\n\t\t_ = conn.Close()\n\t}()\n\n\t_, err = conn.Write([]byte(pkt))\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tbuff, _ := reader.ConnReadNWithTimeout(conn, 4, time.Duration(5)*time.Second)\n\targs, err := structs.Unpack(\">I\", buff)\n\tif err != nil {\n\t\treturn false, err","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/smb/smbghost.go#L25-L61","documentation":"detectSMBGhost (CVE-2020-0796 SMBv3.1.1 compression check) opens a raw TCP connection via protocolstate.GetDialersWithId(executionId). A nil dialer for the execution ID — engine state missing or disposed — produces this error before any packet is sent. Note the host allow-list check runs first, so policy denials surface as ErrHostDenied, not this.","triggerScenarios":"SMBGhost detection invoked in a runtime whose executionId has no registered dialers: uninitialized protocolstate, post-teardown execution, or a hand-rolled runtime outside the nuclei engine.","commonSituations":"Same family as the other dialer errors: SDK misuse, unit tests without engine fixtures, execution IDs from previous process runs.","solutions":["Ensure the code runs inside a nuclei execution with protocolstate initialized","Call protocolstate.InitProtocolState(ctx, options) before scanning in library mode","Set up dialers in test fixtures before invoking detectSMBGhost"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if protocolstate.GetDialersWithId(executionId) == nil {\n    return fmt.Errorf(\"engine not initialized; skip SMBGhost check\")\n}","typeGuard":"func dialersReady(executionId string) bool {\n    return protocolstate.GetDialersWithId(executionId) != nil\n}","tryCatchPattern":"vuln, err := client.DetectSMBGhost(ctx, host, 445)\nif err != nil && strings.Contains(err.Error(), \"dialers not initialized\") {\n    return err // state bug — distinguish from host-level detection errors\n}","preventionTips":["Guarantee protocolstate initialization precedes any SMB detection call","Run detections inside the standard nuclei scan lifecycle only","Set up engine state in test fixtures before probing detection helpers"],"tags":["initialization","internal","network","smb","cve"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}