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

[BUG] Data Race at contextargs.(*MetaInput) #5819

Open
dwisiswant0 opened this issue Nov 14, 2024 · 1 comment
Open

[BUG] Data Race at contextargs.(*MetaInput) #5819

dwisiswant0 opened this issue Nov 14, 2024 · 1 comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@dwisiswant0
Copy link
Member

  1. TestSimpleNuclei
=== RUN   TestSimpleNuclei
[ERR] Could not read nuclei-ignore file: open /home/runner/.config/nuclei/.nuclei-ignore: no such file or directory
[INF] nuclei-templates are not installed, installing...
[INF] Successfully installed nuclei-templates at /home/runner/nuclei-templates
[INF] Templates clustered: 14 (Reduced 10 Requests)
==================
WARNING: DATA RACE
Read at 0x00c003275160 by goroutine 9545:
  github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs.(*MetaInput).Clone()
      /home/runner/work/nuclei/nuclei/pkg/protocols/common/contextargs/metainput.go:148 +0x1d5
  github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs.(*Context).Clone()
      /home/runner/work/nuclei/nuclei/pkg/protocols/common/contextargs/contextargs.go:180 +0x4e
  github.com/projectdiscovery/nuclei/v3/pkg/tmplexec/generic.(*Generic).ExecuteWithResults()
      /home/runner/work/nuclei/nuclei/pkg/tmplexec/generic/exec.go:54 +0x235
  github.com/projectdiscovery/nuclei/v3/pkg/tmplexec.(*TemplateExecuter).Execute()
      /home/runner/work/nuclei/nuclei/pkg/tmplexec/exec.go:212 +0x7d4
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.1()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:139 +0x3ee
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:146 +0x61

Previous write at 0x00c003275160 by goroutine 9542:
  github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs.(*MetaInput).GetScanHash()
      /home/runner/work/nuclei/nuclei/pkg/protocols/common/contextargs/metainput.go:178 +0x2ce
  github.com/projectdiscovery/nuclei/v3/pkg/protocols.(*ExecutorOptions).GetTemplateCtx()
      /home/runner/work/nuclei/nuclei/pkg/protocols/protocols.go:182 +0x4a
  github.com/projectdiscovery/nuclei/v3/pkg/tmplexec/multiproto.(*MultiProtocol).ExecuteWithResults()
      /home/runner/work/nuclei/nuclei/pkg/tmplexec/multiproto/multi.go:56 +0xfd
  github.com/projectdiscovery/nuclei/v3/pkg/tmplexec.(*TemplateExecuter).Execute()
      /home/runner/work/nuclei/nuclei/pkg/tmplexec/exec.go:212 +0x7d4
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.1()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:139 +0x3ee
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:146 +0x61

Goroutine 9545 (running) created at:
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:115 +0x90c
  github.com/projectdiscovery/nuclei/v3/pkg/input/provider.(*SimpleInputProvider).Iterate()
      /home/runner/work/nuclei/nuclei/pkg/input/provider/simple.go:38 +0x90
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:80 +0x7f6
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func1()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:[135](https://github.com/projectdiscovery/nuclei/actions/runs/11828099645/job/32957636296#step:6:136) +0xfa
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:[136](https://github.com/projectdiscovery/nuclei/actions/runs/11828099645/job/32957636296#step:6:137) +0x41

Goroutine 9542 (running) created at:
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:115 +0x90c
  github.com/projectdiscovery/nuclei/v3/pkg/input/provider.(*SimpleInputProvider).Iterate()
      /home/runner/work/nuclei/nuclei/pkg/input/provider/simple.go:38 +0x90
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:80 +0x7f6
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func1()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:135 +0xfa
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:136 +0x41
  1. TestThreadSafeNuclei/honey.scanme.sh
=== RUN   TestThreadSafeNuclei/honey.scanme.sh
[INF] Templates clustered: 14 (Reduced 10 Requests)
==================
WARNING: DATA RACE
Write at 0x00c00f3304e0 by goroutine 28598:
  github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs.(*MetaInput).GetScanHash()
      /home/runner/work/nuclei/nuclei/pkg/protocols/common/contextargs/metainput.go:178 +0x2ce
  github.com/projectdiscovery/nuclei/v3/pkg/protocols.(*ExecutorOptions).GetTemplateCtx()
      /home/runner/work/nuclei/nuclei/pkg/protocols/protocols.go:182 +0x4a
  github.com/projectdiscovery/nuclei/v3/pkg/tmplexec/multiproto.(*MultiProtocol).ExecuteWithResults()
      /home/runner/work/nuclei/nuclei/pkg/tmplexec/multiproto/multi.go:56 +0xfd
  github.com/projectdiscovery/nuclei/v3/pkg/tmplexec.(*TemplateExecuter).Execute()
      /home/runner/work/nuclei/nuclei/pkg/tmplexec/exec.go:212 +0x7d4
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.1()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:139 +0x3ee
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:146 +0x61

Previous read at 0x00c00f3304e0 by goroutine 28597:
  github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs.(*MetaInput).Clone()
      /home/runner/work/nuclei/nuclei/pkg/protocols/common/contextargs/metainput.go:148 +0x1d5
  github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs.(*Context).Clone()
      /home/runner/work/nuclei/nuclei/pkg/protocols/common/contextargs/contextargs.go:180 +0x4e
  github.com/projectdiscovery/nuclei/v3/pkg/templates.(*ClusterExecuter).Execute()
      /home/runner/work/nuclei/nuclei/pkg/templates/cluster.go:237 +0x9e
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.1()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:139 +0x3ee
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2.2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:146 +0x61

Goroutine 28598 (running) created at:
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:115 +0x90c
  github.com/projectdiscovery/nuclei/v3/pkg/input/provider.(*SimpleInputProvider).Iterate()
      /home/runner/work/nuclei/nuclei/pkg/input/provider/simple.go:38 +0x90
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:80 +0x7f6
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func1()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:135 +0xfa
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:136 +0x41

Goroutine 28597 (running) created at:
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:115 +0x90c
  github.com/projectdiscovery/nuclei/v3/pkg/input/provider.(*SimpleInputProvider).Iterate()
      /home/runner/work/nuclei/nuclei/pkg/input/provider/simple.go:38 +0x90
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateWithTargets()
      /home/runner/work/nuclei/nuclei/pkg/core/executors.go:80 +0x7f6
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func1()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:135 +0xfa
  github.com/projectdiscovery/nuclei/v3/pkg/core.(*Engine).executeTemplateSpray.func2()
      /home/runner/work/nuclei/nuclei/pkg/core/execute_options.go:136 +0x41
==================
@dwisiswant0 dwisiswant0 added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Nov 14, 2024
@dwisiswant0
Copy link
Member Author

@dwisiswant0 dwisiswant0 changed the title [BUG] Data Race at contextargs.(*MetaInput).Clone() [BUG] Data Race at contextargs.(*MetaInput) Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

1 participant