projectdiscovery/nuclei · error

headless host concurrency must be at least 1

Error message

headless host concurrency must be at least 1

What it means

parseUNC normalizes backslashes to slashes, drops empty segments, and requires at least two components (host, share). A UNC path naming only a server - or nothing at all - cannot identify a share, so parsing aborts with this error.

Source

Thrown at lib/config.go:139

	HeadlessHostConcurrency       int // number of hosts to scan concurrently for headless templates  (per template in template-spray mode)
	HeadlessTemplateConcurrency   int // number of templates to run concurrently for headless templates (per host in host-spray mode)
	JavascriptTemplateConcurrency int // number of templates to run concurrently for javascript templates (per host in host-spray mode)
	TemplatePayloadConcurrency    int // max concurrent payloads to run for a template (a good default is 25)
	ProbeConcurrency              int // max concurrent http probes to run (a good default is 50)
}

// WithConcurrency sets concurrency options
func WithConcurrency(opts Concurrency) NucleiSDKOptions {
	return func(e *NucleiEngine) error {
		// minimum required is 1
		if opts.TemplateConcurrency <= 0 {
			return errors.New("template threads must be at least 1")
		}
		if opts.HostConcurrency <= 0 {
			return errors.New("host concurrency must be at least 1")
		}
		if opts.HeadlessHostConcurrency <= 0 {
			return errors.New("headless host concurrency must be at least 1")
		}
		if opts.HeadlessTemplateConcurrency <= 0 {
			return errors.New("headless template threads must be at least 1")
		}
		if opts.JavascriptTemplateConcurrency <= 0 {
			return errors.New("js must be at least 1")
		}
		if opts.TemplatePayloadConcurrency <= 0 {
			return errors.New("payload concurrency must be at least 1")
		}
		if opts.ProbeConcurrency <= 0 {
			return errors.New("probe concurrency must be at least 1")
		}
		e.opts.TemplateThreads = opts.TemplateConcurrency
		e.opts.BulkSize = opts.HostConcurrency
		e.opts.HeadlessBulkSize = opts.HeadlessHostConcurrency
		e.opts.HeadlessTemplateThreads = opts.HeadlessTemplateConcurrency
		e.opts.JsConcurrency = opts.JavascriptTemplateConcurrency

View on GitHub (pinned to 265b3a3dec)

Solutions

  1. Complete the path to \\server\share or \\server\share\file.txt
  2. Confirm the share name exists (smbclient -L server, net view) before scanning

Example fix

# before
\\fileserver
# after
\\fileserver\public\report.pdf
Defensive patterns

Strategy: validation

Validate before calling

import "strings"

func uncHasHostAndShare(raw string) bool {
    s := strings.ReplaceAll(raw, "\\", "/")
    s = strings.TrimPrefix(s, "//")
    n := 0
    for _, p := range strings.Split(s, "/") {
        if p != "" {
            n++
        }
    }
    return n >= 2
}

Prevention

When it happens

Trigger: \\server or //server with no share segment; a bare double-backslash path that yields zero components after cleaning.

Common situations: Truncated copy-paste of UNC paths; forgetting the share name when hand-typing targets.

Related errors


AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15). Data as JSON: /api/errors/3d83218b7381fe7e. Report an issue: GitHub.