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

panic: interface conversion: interface {} is nil, not string [recovered] #4922

Closed
geeknik opened this issue Mar 20, 2024 · 0 comments · Fixed by #5065
Closed

panic: interface conversion: interface {} is nil, not string [recovered] #4922

geeknik opened this issue Mar 20, 2024 · 0 comments · Fixed by #5065
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@geeknik
Copy link
Contributor

geeknik commented Mar 20, 2024

Nuclei version:

Version: v3.2.2
Operating System: linux
Architecture: amd64
Go Version: go1.21.8
Compiler: gc
File "/root/.config/nuclei/config.yaml" Read => Ok
File "/root/.config/nuclei/config.yaml" Write => Ok
File "/root/.config/nuclei/.nuclei-ignore" Read => Ok
File "/root/.config/nuclei/.nuclei-ignore" Write => Ok
File "/root/.bbot/tools/nuclei-templates/.checksum" Read => Ok
File "/root/.bbot/tools/nuclei-templates/.checksum" Write => Ok
IPv4 connectivity to scanme.sh:80 => Ok
IPv6 connectivity to scanme.sh:80 => Ko (dial tcp6 [2400:6180:0:d0::91:1001]:80: connect: network is unreachable)
IPv4 UDP connectivity to scanme.sh:53 => Ok

Current Behavior:

panic: interface conversion: interface {} is nil, not string [recovered]
	panic: interface conversion: interface {} is nil, not string [recovered]
	panic: interface conversion: interface {} is nil, not string [recovered]
	panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
gopkg.in/yaml%2ev2.handleErr(0xc000c8eb60)
	gopkg.in/yaml.v2@v2.4.0/yaml.go:249 +0x6d
panic({0x2614840?, 0xc0010e1650?})
	runtime/panic.go:914 +0x21f
gopkg.in/yaml%2ev2.handleErr(0xc000c8e840)
	gopkg.in/yaml.v2@v2.4.0/yaml.go:249 +0x6d
panic({0x2614840?, 0xc0010e1650?})
	runtime/panic.go:914 +0x21f
gopkg.in/yaml%2ev2.handleErr(0xc000c8e040)
	gopkg.in/yaml.v2@v2.4.0/yaml.go:249 +0x6d
panic({0x2614840?, 0xc0010e1650?})
	runtime/panic.go:914 +0x21f
github.com/projectdiscovery/nuclei/v3/pkg/utils.(*InsertionOrderedStringMap).UnmarshalYAML(0xc002e43540, 0xc00234da00)
	github.com/projectdiscovery/nuclei/v3/pkg/utils/insertion_ordered_map.go:43 +0x26c
gopkg.in/yaml%2ev2.(*decoder).callUnmarshaler(0xc000e45a40, 0xc00236f810, {0x7f3406f55e50, 0xc002e43540})
	gopkg.in/yaml.v2@v2.4.0/decode.go:270 +0x94
gopkg.in/yaml%2ev2.(*decoder).prepare(0xc0029873a0?, 0xc00236f810, {0x2773600?, 0xc002e43540?, 0xc000c8dff8?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:313 +0x245
gopkg.in/yaml%2ev2.(*decoder).unmarshal(0xc000e45a40, 0xc00236f810, {0x2773600?, 0xc002e43540?, 0xc000c8e220?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:364 +0x13b
gopkg.in/yaml%2ev2.(*decoder).callUnmarshaler.func1({0x2773600?, 0xc002e43540?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:272 +0xe5
github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/variables.(*Variable).UnmarshalYAML(0xc002e43538, 0xc002e43538?)
	github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/variables/variables.go:36 +0x6d
gopkg.in/yaml%2ev2.(*decoder).callUnmarshaler(0xc000e45a40, 0xc00236f810, {0x7f3406f55e30, 0xc002e43538})
	gopkg.in/yaml.v2@v2.4.0/decode.go:270 +0x94
gopkg.in/yaml%2ev2.(*decoder).prepare(0x41638c?, 0xc00236f810, {0x279bd00?, 0xc002e43538?, 0xf100000000000098?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:313 +0x245
gopkg.in/yaml%2ev2.(*decoder).unmarshal(0xc000e45a40, 0xc00236f810, {0x279bd00?, 0xc002e43538?, 0x0?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:364 +0x13b
gopkg.in/yaml%2ev2.(*decoder).mappingStruct(0xc000e45a40, 0xc00236f180, {0x29e15a0?, 0xc002e43340?, 0x121a1c5?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:767 +0xe4b
gopkg.in/yaml%2ev2.(*decoder).mapping(0xf?, 0xc00236f180?, {0x29e15a0?, 0xc002e43340?, 0x0?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:626 +0x470
gopkg.in/yaml%2ev2.(*decoder).unmarshal(0xc000e45a40, 0xc00236f180, {0x2438f20?, 0xc002e43340?, 0x288?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:372 +0x1a5
gopkg.in/yaml%2ev2.(*decoder).callUnmarshaler.func1({0x2438f20?, 0xc002e43340?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:272 +0xe5
github.com/projectdiscovery/nuclei/v3/pkg/templates.(*Template).UnmarshalYAML(0xc002e42dc0, 0xc00234d9c0)
	github.com/projectdiscovery/nuclei/v3/pkg/templates/templates.go:316 +0x52
gopkg.in/yaml%2ev2.(*decoder).callUnmarshaler(0xc000e45a40, 0xc00236f180, {0x7f340703a730, 0xc002e42dc0})
	gopkg.in/yaml.v2@v2.4.0/decode.go:270 +0x94
gopkg.in/yaml%2ev2.(*decoder).prepare(0xc000c8ea01?, 0xc00236f180, {0x29e12a0?, 0xc002e42dc0?, 0xc003e0f5d8?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:313 +0x245
gopkg.in/yaml%2ev2.(*decoder).unmarshal(0xc000e45a40, 0xc00236f180, {0x29e12a0?, 0xc002e42dc0?, 0x120032b?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:364 +0x13b
gopkg.in/yaml%2ev2.(*decoder).document(...)
	gopkg.in/yaml.v2@v2.4.0/decode.go:384
gopkg.in/yaml%2ev2.(*decoder).unmarshal(0x294ab80?, 0xc002e42dc0?, {0x29e12a0?, 0xc002e42dc0?, 0x410785?})
	gopkg.in/yaml.v2@v2.4.0/decode.go:360 +0x110
gopkg.in/yaml%2ev2.unmarshal({0xc002b45180, 0x289, 0x380}, {0x294ab80, 0xc002e42dc0}, 0x0)
	gopkg.in/yaml.v2@v2.4.0/yaml.go:148 +0x39c
gopkg.in/yaml%2ev2.Unmarshal(...)
	gopkg.in/yaml.v2@v2.4.0/yaml.go:81
github.com/projectdiscovery/nuclei/v3/pkg/templates.parseTemplate({_, _, _}, {{0x0, 0x0}, {0xc002791740, 0x33}, {{0x0, 0x0}, {{0x0, ...}}, ...}, ...})
	github.com/projectdiscovery/nuclei/v3/pkg/templates/compile.go:321 +0x125
github.com/projectdiscovery/nuclei/v3/pkg/templates.ParseTemplateFromReader({_, _}, {_, _}, {{0x0, 0x0}, {0xc002791740, 0x33}, {{0x0, 0x0}, ...}, ...})
	github.com/projectdiscovery/nuclei/v3/pkg/templates/compile.go:266 +0x4f8
github.com/projectdiscovery/nuclei/v3/pkg/templates.Parse({_, _}, {_, _}, {{0x0, 0x0}, {0x0, 0x0}, {{0x0, 0x0}, ...}, ...})
	github.com/projectdiscovery/nuclei/v3/pkg/templates/compile.go:78 +0x4f0
github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader.(*Store).areWorkflowOrTemplatesValid(0xc000e20090, 0xc000c8ff18?, 0x0, 0x31f6b30)
	github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader/loader.go:303 +0x1ab
github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader.(*Store).areTemplatesValid(...)
	github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader/loader.go:286
github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader.(*Store).ValidateTemplates(0xc000e20090)
	github.com/projectdiscovery/nuclei/v3/pkg/catalog/loader/loader.go:272 +0x34f
github.com/projectdiscovery/nuclei/v3/internal/runner.(*Runner).RunEnumeration(0xc0003f82a0)
	github.com/projectdiscovery/nuclei/v3/internal/runner/runner.go:489 +0x1317
main.main()
	./main.go:170 +0x665

Expected Behavior:

No crash.

Steps To Reproduce:

  1. go install -v github.com/xm1k3/cent@latest && cent
  2. nuclei -t cent-nuclei-templates/ -validate

Anything else:

🕵🏻

@geeknik geeknik added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Mar 20, 2024
@RamanaReddy0M RamanaReddy0M self-assigned this Apr 17, 2024
@RamanaReddy0M RamanaReddy0M linked a pull request Apr 17, 2024 that will close this issue
4 tasks
@ehsandeep ehsandeep added this to the nuclei v3.2.5 milestone Apr 18, 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

Successfully merging a pull request may close this issue.

3 participants