shadow1ng/fscan · error

webscan_err_empty_target

Error message

webscan_err_empty_target

What it means

Sentinel validation error (ErrEmptyTarget) checked before a POC scan runs: the pocInfo.Target field is an empty string, so there is no URL/host to scan and the scan for this POC is skipped. It is a guard on user-supplied target input, not an I/O failure.

Source

Thrown at webscan/web_scan.go:37

	"github.com/shadow1ng/fscan/common/config"
	"github.com/shadow1ng/fscan/common/i18n"
	"github.com/shadow1ng/fscan/webscan/lib"
)

// 常量定义
const (
	protocolHTTP     = "http://"
	protocolHTTPS    = "https://"
	yamlExt          = ".yaml"
	ymlExt           = ".yml"
	defaultTimeout   = 30 * time.Second
	concurrencyLimit = 10 // 并发加载POC的限制
)

// 错误定义
var (
	ErrInvalidURL    = errors.New(i18n.GetText("webscan_err_invalid_url"))
	ErrEmptyTarget   = errors.New(i18n.GetText("webscan_err_empty_target"))
	ErrPocNotFound   = errors.New(i18n.GetText("webscan_err_poc_not_found"))
	ErrPocLoadFailed = errors.New(i18n.GetText("webscan_err_poc_load_failed"))
)

//go:embed pocs
var pocsFS embed.FS

// pocStore 按 PocPath 缓存已加载的 POC 集合,支持多 session 使用不同 POC 路径
type pocStore struct {
	mu    sync.Mutex
	cache map[string][]*lib.Poc // key: pocPath(空字符串表示内嵌 POC)
}

var globalPocStore = &pocStore{cache: make(map[string][]*lib.Poc)}

// WebScan 执行Web漏洞扫描
func WebScan(ctx context.Context, info *common.HostInfo, cfg *common.Config, session *common.ScanSession) {
	// 初始化POC配置(用于CEL回调函数)

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Ensure the target field is populated when queuing web scan tasks
  2. Skip and log the empty-target entry instead of aborting the whole scan
  3. Validate targets at POC-scheduling time
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at webscan/web_scan.go:37 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06). Data as JSON: /api/errors/2db58724ebe2b734. Report an issue: GitHub.