projectdiscovery/nuclei · error
dialers not initialized for %s
Error message
dialers not initialized for %s
What it means
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.
Source
Thrown at pkg/js/libs/smb/smbghost.go:43
// ```javascript
// const smb = require('nuclei/smb');
// const isSMBGhost = smb.DetectSMBGhost('acme.com', 445);
// ```
func (c *SMBClient) DetectSMBGhost(ctx context.Context, host string, port int) (bool, error) {
executionId := ctx.Value("executionId").(string)
return memoizeddetectSMBGhost(ctx, executionId, host, port)
}
// @memo
func detectSMBGhost(ctx context.Context, executionId string, host string, port int) (bool, error) {
if !protocolstate.IsHostAllowed(executionId, host) {
// host is not valid according to network policy
return false, protocolstate.ErrHostDenied.Msgf(host)
}
addr := net.JoinHostPort(host, strconv.Itoa(port))
dialer := protocolstate.GetDialersWithId(executionId)
if dialer == nil {
return false, fmt.Errorf("dialers not initialized for %s", executionId)
}
conn, err := dialer.Fastdialer.Dial(ctx, "tcp", addr)
if err != nil {
return false, err
}
defer func() {
_ = conn.Close()
}()
_, err = conn.Write([]byte(pkt))
if err != nil {
return false, err
}
buff, _ := reader.ConnReadNWithTimeout(conn, 4, time.Duration(5)*time.Second)
args, err := structs.Unpack(">I", buff)
if err != nil {
return false, errView on GitHub (pinned to 265b3a3dec)
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
Defensive patterns
Strategy: validation
Validate before calling
if protocolstate.GetDialersWithId(executionId) == nil {
return fmt.Errorf("engine not initialized; skip SMBGhost check")
} Type guard
func dialersReady(executionId string) bool {
return protocolstate.GetDialersWithId(executionId) != nil
} Try / catch
vuln, err := client.DetectSMBGhost(ctx, host, 445)
if err != nil && strings.Contains(err.Error(), "dialers not initialized") {
return err // state bug — distinguish from host-level detection errors
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Same family as the other dialer errors: SDK misuse, unit tests without engine fixtures, execution IDs from previous process runs.
Related errors
- dialers not initialized for %s
- dialers not initialized for %s
- smb connect: %w
- open pipe %q: %w
- dialers not initialized for execution %s
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/5daea1324e0cdf4c.
Report an issue: GitHub.