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

data race in race requests #3274

Closed
tarunKoyalwar opened this issue Feb 6, 2023 · 0 comments · Fixed by #3275
Closed

data race in race requests #3274

tarunKoyalwar opened this issue Feb 6, 2023 · 0 comments · Fixed by #3275
Assignees
Labels
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.
Milestone

Comments

@tarunKoyalwar
Copy link
Member

Nuclei version:

dev | main

Current Behavior:

  • Due to a data race in nuclei race template requests . It randomly panics

Expected Behavior:

No Panic

Steps To Reproduce:

$ ./debug.sh http race-simple
::group::Build nuclei
::endgroup::


::group::Run Integration Test

./nuclei -t http/race-simple.yaml -target http://127.0.0.1:50226 -duc -debug

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

		projectdiscovery.io

[INF] Using Nuclei Engine 2.8.8 (latest)
[INF] Using Nuclei Templates 9.3.6 (latest)
[INF] Templates added in last update: 30
[INF] Templates loaded for scan: 1
[INF] Targets loaded for scan: 1
[INF] [race-condition-testing] Dumped HTTP request for http://127.0.0.1:50226

GET / HTTP/1.1
Host: 127.0.0.1:50226
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2656.18 Safari/537.36
Connection: close
Content-Length: 10
Accept-Encoding: gzip

test      
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50226/
...
==================
WARNING: DATA RACE
Write at 0x00c001704c8f by goroutine 61:
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer.(*Executer).Execute.func2()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/common/executer/executer.go:101 +0x288
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRequest()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:755 +0x3438
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRaceRequest.func1()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:107 +0xb0
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRaceRequest.func2()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:113 +0x44

Previous write at 0x00c001704c8f by goroutine 65:
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer.(*Executer).Execute.func2()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/common/executer/executer.go:101 +0x288
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRequest()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:755 +0x3438
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRaceRequest.func1()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:107 +0xb0
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRaceRequest.func2()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:113 +0x44

Goroutine 61 (running) created at:
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRaceRequest()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:105 +0x824
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).ExecuteWithResults()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:327 +0x208
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer.(*Executer).Execute()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/common/executer/executer.go:80 +0x68c
  github.com/projectdiscovery/nuclei/v2/pkg/core.(*Engine).executeTemplateWithTargets.func2.1()
      /Users/tarun/Codebase2/nuclei/v2/pkg/core/executors.go:130 +0x418
  github.com/projectdiscovery/nuclei/v2/pkg/core.(*Engine).executeTemplateWithTargets.func2.2()
      /Users/tarun/Codebase2/nuclei/v2/pkg/core/executors.go:137 +0x60

Goroutine 65 (finished) created at:
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).executeRaceRequest()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:105 +0x824
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/http.(*Request).ExecuteWithResults()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/http/request.go:327 +0x208
  github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/executer.(*Executer).Execute()
      /Users/tarun/Codebase2/nuclei/v2/pkg/protocols/common/executer/executer.go:80 +0x68c
  github.com/projectdiscovery/nuclei/v2/pkg/core.(*Engine).executeTemplateWithTargets.func2.1()
      /Users/tarun/Codebase2/nuclei/v2/pkg/core/executors.go:130 +0x418
  github.com/projectdiscovery/nuclei/v2/pkg/core.(*Engine).executeTemplateWithTargets.func2.2()
      /Users/tarun/Codebase2/nuclei/v2/pkg/core/executors.go:137 +0x60
==================
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50226/
...
exit status 66%                                                                                       

Anything else:

@tarunKoyalwar tarunKoyalwar added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Feb 6, 2023
@tarunKoyalwar tarunKoyalwar linked a pull request Feb 6, 2023 that will close this issue
4 tasks
@tarunKoyalwar tarunKoyalwar self-assigned this Feb 6, 2023
@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Feb 7, 2023
@ehsandeep ehsandeep added this to the nuclei v2.8.9 milestone Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants