/claim #6674

Fix: Replace Panic with Error in Template Loader

Refactored LoadTemplatesWithTags and the call chain to properly propagate errors instead of panicking when dialers are missing.

Changes

  • pkg/catalog/loader/loader.go: Updated LoadTemplatesWithTags, LoadTemplates, and Load to return errors instead of panicking.
  • internal/runner/runner.go: Updated caller to handle error returns from store.Load().
  • internal/runner/lazy.go: Updated GetLazyAuthFetchCallback to handle errors.
  • pkg/protocols/common/automaticscan/util.go: Updated helper to handle error returns.
  • pkg/catalog/loader/loader_bench_test.go: Updated benchmark tests to accommodate the new function signatures.

Verification

  • Manual code review confirms error propagation throughout the call stack.
  • Benchmark test signatures updated to prevent compilation failure.

Summary by CodeRabbit

  • New Features

    • Lazy authentication template fetching for dynamic credential retrieval.
    • Full-featured template/workflow loader with advanced filtering, validation, metadata caching, remote/template URI support, and preprocessor hooks.
    • Runner framework for template-based enumeration with lifecycle management, resume support, tracing, and optional cloud result uploads.
    • Utilities to resolve template directories and load templates by tags with clustering and reporting.
  • Tests

    • Added benchmarks for template loading and validation performance.

Claim

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

Contributors

GE

geraldmarcos

@geraldmarcos

100%

Sponsors

PR

ProjectDiscovery

@projectdiscovery

$100
MA

Madhavan Deepak

@Madhavan-Deepak

$100