projectdiscovery/nuclei · error
host concurrency must be at least 1
Error message
host concurrency must be at least 1
What it means
After net/url.Parse succeeds, an smb:// URL with an empty host is rejected: u.Host must be non-empty because the SMB bridge must dial a concrete server on port 445. This catches URLs where the host was omitted or the whole authority slid into the path.
Source
Thrown at lib/config.go:136
type Concurrency struct {
TemplateConcurrency int // number of templates to run concurrently (per host in host-spray mode)
HostConcurrency int // number of hosts to scan concurrently (per template in template-spray mode)
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.HostConcurrencyView on GitHub (pinned to 265b3a3dec)
Solutions
- Include the host: smb://server/share/file.txt
- Check the string between // and the first / is not empty
- Pre-validate generated URLs before scanning
Example fix
# before smb:///share/file.txt # after smb://fileserver/share/file.txt
Defensive patterns
Strategy: validation
Validate before calling
import "net/url"
func smbURLHasHost(raw string) bool {
u, err := url.Parse(raw)
if err != nil {
return false
}
return u.Host != ""
} Prevention
- Never strip the hostname when templating smb:// URLs
- Test expanded URLs with a parser before scanning
When it happens
Trigger: smb:///share/file.txt (three slashes) or smb:// - no host component to dial.
Common situations: Typos deleting the hostname; template variables for the host expanding to an empty string.
Related errors
- headless template threads must be at least 1
- no input provider found
- template threads must be at least 1
- http: invalid url: %w
- http: url must include scheme and host
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/be87630c4e57a203.
Report an issue: GitHub.