-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix data race in race requests #3275
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./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:50374 -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:50374
GET / HTTP/1.1
Host: 127.0.0.1:50374
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2866.71 Safari/537.36
Connection: close
Content-Length: 10
Accept-Encoding: gzip
test
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[DBG] [race-condition-testing] Dumped HTTP response http://127.0.0.1:50374/
HTTP/1.1 200 OK
Connection: close
Date: Mon, 06 Feb 2023 10:46:56 GMT
Content-Length: 0
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
[race-condition-testing:status-1] [http] [info] http://127.0.0.1:50374/
|
Mzack9999
approved these changes
Feb 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - nice catch!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
atomic.Bool{}
to track match status etc . The actual protocol executor inpkg/protocols/common/executor/*
usedbool
which is not concurrency safe and caused panic randomly with race requests (or other conditions were matcher status is used in parallel)Checklist