Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1b6c1d6 #2979

Closed
Teicu opened this issue Dec 6, 2022 · 20 comments · Fixed by #3004 or #3006
Closed

signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1b6c1d6 #2979

Teicu opened this issue Dec 6, 2022 · 20 comments · Fixed by #3004 or #3006
Assignees
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@Teicu
Copy link

Teicu commented Dec 6, 2022

Hi, I get this error using the latest version of Nuclei from MacBook Pro 2019

Nuclei Engine 2.8.1 (latest)
Nuclei Templates 9.3.0 (latest)

[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x1b6c1d6]

goroutine 1481646 [running]:
github.com/projectdiscovery/nuclei/v2/pkg/input.(*Helper).convertInputToType(0xc0024b6028, {0xc00afe0d00, 0xc8}, 0x4, {0x0, 0x0})
	github.com/projectdiscovery/nuclei/v2/pkg/input/input.go:72 +0x96
github.com/projectdiscovery/nuclei/v2/pkg/input.(*Helper).Transform(0x1046973?, {0xc00afe0d00?, 0x8?}, 0x1304efd?)
	github.com/projectdiscovery/nuclei/v2/pkg/input/input.go:43 +0x7f
github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer.(*Executer).Execute(0xc0021b0d60, 0xc0033c2940)
	github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer/executer.go:75 +0x2c6
github.com/projectdiscovery/nuclei/v2/pkg/core.(*Engine).executeModelWithInput.func2.1(0x132a226?, 0x0?, 0xc0033c2800)
	github.com/projectdiscovery/nuclei/v2/pkg/core/execute.go:146 +0x182
created by github.com/projectdiscovery/nuclei/v2/pkg/core.(*En
	github.com/projectdiscovery/nuclei/v2/pkg/core/execute.go:131 +0x745

@Teicu Teicu added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Dec 6, 2022
@ehsandeep
Copy link
Member

@Teicu could you also share the cmd you used to run? I'm running on same system and unable to repro this.

@Teicu
Copy link
Author

Teicu commented Dec 6, 2022

Hi

nuclei -l urls.txt -tags CVE

I'd like to point out that there are about a 500k links in the url.txt list

Cheers

@ehsandeep ehsandeep added the Investigation Something to Investigate label Dec 6, 2022
@tarunKoyalwar
Copy link
Member

Most Likely urls.txt are not standard urls (missing protocol or has parameters etc)

	notURL := !strings.Contains(input, "://")
	parsed, _ := url.Parse(input)
	var host, port string
	if !notURL {
		host, port, _ = net.SplitHostPort(parsed.Host)
	} else {
		host, port, _ = net.SplitHostPort(input)
	}

most likely parsed.input is empty which caused this error

@tarunKoyalwar tarunKoyalwar self-assigned this Dec 6, 2022
@Teicu
Copy link
Author

Teicu commented Dec 6, 2022

Most Likely urls.txt are not standard urls (missing protocol or has parameters etc)

	notURL := !strings.Contains(input, "://")
	parsed, _ := url.Parse(input)
	var host, port string
	if !notURL {
		host, port, _ = net.SplitHostPort(parsed.Host)
	} else {
		host, port, _ = net.SplitHostPort(input)
	}

most likely parsed.input is empty which caused this error

No, all URLs are https://website.com. It's not the first time I've used Nuclei, so that's by no means the problem.

@tarunKoyalwar tarunKoyalwar added the Status: In Progress This issue is being worked on, and has someone assigned. label Dec 6, 2022
@tarunKoyalwar
Copy link
Member

@Teicu , I have uploaded fix along with other edge cases to issue-2979-url-panic branch . can you try installing nuclei again with following command

go install -v  github.com/projectdiscovery/nuclei/v2/cmd/nuclei@issue-2979-url-panic 

and share if you are facing same issue .

@pdelteil
Copy link

pdelteil commented Dec 6, 2022

@Teicu , I have uploaded fix along with other edge cases to issue-2979-url-panic branch . can you try installing nuclei again with following command

go install -v  github.com/projectdiscovery/nuclei/v2/cmd/nuclei@issue-2979-url-panic 

and share if you are facing same issue .

Hi there,

I had the same issue. The problem was originated due to the go version, go.1.18 is required.

I tried to run go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@issue-2979-url-panic having this output (truncated) :

../go/pkg/mod/golang.org/x/exp@v0.0.0-20221019170559-20944726eadf/maps/maps.go:88:16: too many errors
note: module requires Go 1.18

I was using Go 1.17, so I updated to the latest version [1.19.3] and now it works fine. (Using an input file with 1,8 MM urls).

@Teicu
Copy link
Author

Teicu commented Dec 6, 2022

Sorry but I'm using go version go1.19.2 darwin/amd64

@pdelteil
Copy link

pdelteil commented Dec 6, 2022

Sorry but I'm using go version go1.19.2 darwin/amd64

Hi there,

What was the output of go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@issue-2979-url-panic ?

In my case I had installed 2 go versions. Show the output of this command whereis go

@Teicu
Copy link
Author

Teicu commented Dec 6, 2022

whereis go
go: /usr/local/bin/go

@tarunKoyalwar
Copy link
Member

@Teicu have you tried nuclei from another branch ??

@pdelteil
Copy link

pdelteil commented Dec 6, 2022

whereis go go: /usr/local/bin/go

and the other one? from go install?

@mardinyadegar
Copy link

mardinyadegar commented Dec 6, 2022

@ehsandeep I am able to reproduce the issue. I am using alpine linux docker container which installs the latest version of go (apk add go) and Nuclei as per Nuclei documentation.

% nuclei -H "User-Agent:non-generic-ua" -H "customheader:boolean" -list nuclei_hosts_to_scan_final.txt -t /usr/nucl
ei-templates -o scan-vulnerabilities.txt
[INF] Using Nuclei Engine 2.8.1 (latest)                                                                                                
[INF] Using Nuclei Templates 9.3.0 (latest)

panic: runtime error: invalid memory address or nil pointer dereference                                                                       
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xf684b6]                                                                       
                                                                                                                                              
goroutine 47 [running]:                                                                                                                       
github.com/projectdiscovery/nuclei/v2/pkg/input.(*Helper).convertInputToType(0xc000128a18, {0xc009174120, 0x25}, 0x4, {0x0, 0x0})

@tarunKoyalwar
Copy link
Member

@mardinyadegar @Teicu can you confirm that nuclei fails after installing from issue-2979-url-panic

go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@issue-2979-url-panic

If it fails can you post command ouput as well as a link maybe containing urls .

@mardinyadegar
Copy link

@tarunKoyalwar using that suggestion got me no different results.

@mardinyadegar
Copy link

I don't see this as an acceptable solution, but when I switched back to v2.7.9, I noticed it was working properly again.

@vzamanillo
Copy link
Contributor

It's hard to find the problem if we are not able to reproduce it, could you please share your url file?

@ehsandeep
Copy link
Member

@tarunKoyalwar @vzamanillo @Ice3man543 from #2996

$ echo 'https://~^(.*-pre)\.smth\.google\.com/' | nuclei -id tech-detect -silent

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x10343eb48]

goroutine 59 [running]:
github.com/projectdiscovery/nuclei/v2/pkg/input.(*Helper).convertInputToType(0x1400052c028, {0x14002439f50, 0x26}, 0x4, {0x0, 0x0})
	github.com/projectdiscovery/nuclei/v2/pkg/input/input.go:72 +0x68
github.com/projectdiscovery/nuclei/v2/pkg/input.(*Helper).Transform(0x1400053a608?, {0x14002439f50?, 0x1400053a5a8?}, 0x1029abde8?)
	github.com/projectdiscovery/nuclei/v2/pkg/input/input.go:43 +0x88
github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer.(*Executer).Execute(0x14001ef83e0, 0x14002449400)
	github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer/executer.go:75 +0x298
github.com/projectdiscovery/nuclei/v2/pkg/core.(*Engine).executeModelWithInput.func2.1(0x0?, 0x0?, 0x14002449360)
	github.com/projectdiscovery/nuclei/v2/pkg/core/execute.go:146 +0x148
created by github.com/projectdiscovery/nuclei/v2/pkg/core.(*Engine).executeModelWithInput.func2
	github.com/projectdiscovery/nuclei/v2/pkg/core/execute.go:131 +0x618

@ehsandeep ehsandeep added the Priority: High After critical issues are fixed, these should be dealt with before any further issues. label Dec 8, 2022
@tarunKoyalwar
Copy link
Member

@ehsandeep already fixed with https://github.com/projectdiscovery/nuclei/tree/issue-2979-url-panic

echo 'https://~^(.*-pre)\.smth\.google\.com/' | go run . -id tech-detect      

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.8.1

		projectdiscovery.io

[INF] Using Nuclei Engine 2.8.1 (latest)
[INF] Using Nuclei Templates 9.3.1 (latest)
[INF] Templates added in last update: 2
[INF] Templates loaded for scan: 1
[INF] Targets loaded for scan: 1
[INF] No results found. Better luck next time!
tarun@Taruns-MacBook-Pro:~/reviews/nuclei/v2/cmd/nuclei(issue-2979-url-panic○) » 

@tarunKoyalwar
Copy link
Member

Can't Say why but Earlier go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@issue-2979-url-panic did not install from issue-2979-url-panic branch .

@tarunKoyalwar tarunKoyalwar linked a pull request Dec 8, 2022 that will close this issue
4 tasks
@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: In Progress This issue is being worked on, and has someone assigned. Investigation Something to Investigate labels Dec 8, 2022
@ehsandeep ehsandeep linked a pull request Dec 8, 2022 that will close this issue
4 tasks
@ehsandeep
Copy link
Member

@Teicu @mardinyadegar @pdelteil should be fixed now with the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High After critical issues are fixed, these should be dealt with before any further issues. Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants