Description

Fixes #6674

Replaces panic calls in LoadTemplatesWithTags with proper error returns when dialers are missing or wait group creation fails.

Changes

  • pkg/catalog/loader/loader.go: Changed LoadTemplates and LoadTemplatesWithTags signatures to return ([]*templates.Template, error). Replaced both panic() calls with fmt.Errorf() returns.
  • internal/runner/lazy.go: Updated caller to handle the new error return from LoadTemplates.
  • pkg/protocols/common/automaticscan/util.go: Updated caller to handle the new error return from LoadTemplatesWithTags.
  • pkg/catalog/loader/loader_bench_test.go: Updated benchmark tests for the new function signatures.

Testing

  • go build ./... passes
  • All existing callers properly handle the new error return

/claim #6674

Summary by CodeRabbit

  • Bug Fixes

    • Improved template loading: functions now surface and propagate errors instead of panicking.
    • Added validation to ensure exactly one matching template is used; returns errors for no or multiple matches.
    • Improved error propagation during template execution and loading paths.
  • Tests

    • Updated benchmarks to reflect the updated template-loading return values.

Claim

Total prize pool $200
Total paid $0
Status Pending
Submitted February 16, 2026
Last updated February 16, 2026

Contributors

JP

jpirstin

@jpirstin

100%

Sponsors

PR

ProjectDiscovery

@projectdiscovery

$100
MA

Madhavan Deepak

@Madhavan-Deepak

$100