-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.
Description
Is there an existing issue for this?
- I have searched the existing issues.
Current Behavior
If i use ThreadSafeNucleiEngine with option e.Options().NoHostErrors = true leads to internal panic in hosterrorscache.(*Cache).Check function when accessing to uninitialised failedTargets inside Cache struct.
Expected Behavior
No panic.
Steps To Reproduce
func withNoHostErrors(e *nuclei.NucleiEngine) error {
e.Options().NoHostErrors = true
return nil
}
func main() {
options := []nuclei.NucleiSDKOptions{
withNoHostErrors,
}
ne, err := nuclei.NewThreadSafeNucleiEngineCtx(context.TODO(), options...)
if err != nil {
errExit(err)
}
if err := ne.GlobalLoadAllTemplates(); err != nil {
errExit(err)
}
ne.GlobalResultCallback(func(event *output.ResultEvent) {
fmt.Println(event.Host, event.Info.SeverityHolder.Severity)
})
if err := ne.ExecuteNucleiWithOptsCtx(context.TODO(), []string{"scanme.nmap.org"}); err != nil {
errExit(err)
}
}
func errExit(err error) {
fmt.Println(err)
os.Exit(1)
}Relevant log output
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1019d5148]
goroutine 39805 [running]:
github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/hosterrorscache.(*Cache).Check(0x0, {0x106cece20?, 0x0?}, 0x0?)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/protocols/common/hosterrorscache/hosterrorscache.go:132 +0x48
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func3(0x14013262600)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/executors.go:153 +0x468
github.com/projectdiscovery/nuclei/v3/pkg/input/provider.(*SimpleInputProvider).Iterate(0x14037e02010?, 0x1402d18ca00)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/input/provider/simple.go:38 +0x60
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets(0x1400f599800, {0x1050d6980, 0x106cece20}, 0x14024c94588, {0x1050e48b0, 0x14013c77d40}, 0x14007a2b358)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/executors.go:123 +0x3ec
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func1(0x140255f5cc0?)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/execute_options.go:136 +0x5c
created by github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray in goroutine 1
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/execute_options.go:131 +0x8c
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1019d5148]
goroutine 39799 [running]:
github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/hosterrorscache.(*Cache).Check(0x0, {0x106cece20?, 0x0?}, 0x0?)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/protocols/common/hosterrorscache/hosterrorscache.go:132 +0x48
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func3(0x14013262600)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/executors.go:153 +0x468
github.com/projectdiscovery/nuclei/v3/pkg/input/provider.(*SimpleInputProvider).Iterate(0x1401af5e010?, 0x1402d162a00)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/input/provider/simple.go:38 +0x60
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets(0x1400f599800, {0x1050d6980, 0x106cece20}, 0x1402499a848, {0x1050e48b0, 0x14013c77d40}, 0x14007a2b358)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/executors.go:123 +0x3ec
github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func1(0x14025626820?)
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/execute_options.go:136 +0x5c
created by github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray in goroutine 1
/Users/***/go/pkg/mod/github.com/projectdiscovery/nuclei/v3@v3.7.0/pkg/core/execute_options.go:131 +0x8c
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1019d5148]Environment
- OS: MacOS 15.7.3
- Nuclei: v3.7.0
- Go: 1.25.0Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.Inconsistencies or issues which will cause an issue or problem for users or implementors.