projectdiscovery/nuclei · error
headless template threads must be at least 1
Error message
headless template threads must be at least 1
What it means
splitSharePath trims slashes off the smb:// URL path and errors when nothing remains: every smb:// URL must name at least host/share. smb://host or smb://host/ leaves no share segment, so parsing aborts before any connection is attempted.
Source
Thrown at lib/config.go:142
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
e.opts.PayloadConcurrency = opts.TemplatePayloadConcurrency
e.opts.ProbeConcurrency = opts.ProbeConcurrency
return nilView on GitHub (pinned to 265b3a3dec)
Solutions
- Add the share name: smb://host/share/file.txt
- List available shares first and use an exact name
Example fix
# before smb://fileserver/ # after smb://fileserver/public/report.pdf
Defensive patterns
Strategy: validation
Validate before calling
import (
"net/url"
"strings"
)
func smbURLHasShare(raw string) bool {
u, err := url.Parse(raw)
if err != nil {
return false
}
return strings.Trim(u.Path, "/") != ""
} Prevention
- Include /share in every smb:// URL
- Enumerate shares separately from file scans
When it happens
Trigger: smb://host or smb://host/ passed as a file target - the path component is empty after trimming slashes.
Common situations: Probing host reachability with a bare smb://host URL; the share name typo'd into the host part.
Related errors
- host concurrency must be at least 1
- share path contains NUL
- share name must not contain path separators: %q
- no templates provided for scan
- no input provider found
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/656863c447ff010c.
Report an issue: GitHub.