shadow1ng/fscan · error

webscan_poc_parse_failed

webscan_poc_parse_failed

Error message

webscan_poc_parse_failed %s: %w

What it means

Guard in parsePocYAML: LoadUniversalPoc failed to parse the POC file's YAML content, so the named file is skipped (LoadMultiPoc logs it via webscan_poc_load_one_failed) and the error wraps the parse failure with the offending file name.

Solutions

  1. Fix YAML syntax errors in the named POC file
  2. Ensure the POC matches the supported format/schema
  3. Regenerate or re-download a known-good POC file
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at webscan/lib/Client.go:421 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/a73274c8991d46c6. Report an issue: GitHub.

Appendix: source

Thrown at webscan/lib/Client.go:421

func LoadMultiPoc(Pocs embed.FS, pocname string) []*Poc {
	var pocs []*Poc
	// 遍历选中的POC文件
	for _, f := range SelectPoc(Pocs, pocname) {
		if p, err := LoadPoc(f, Pocs); err == nil {
			pocs = append(pocs, p)
		} else {
			common.LogError(i18n.Tr("webscan_poc_load_one_failed", f, err))
		}
	}
	return pocs
}

// parsePocYAML 解析POC YAML内容(提取公共逻辑)
func parsePocYAML(data []byte, fileName string) (*Poc, error) {
	// 使用通用适配器加载POC(自动识别格式)
	universalPoc, err := LoadUniversalPoc(fileName, data)
	if err != nil {
		return nil, fmt.Errorf("%s %s: %w", i18n.GetText("webscan_poc_parse_failed"), fileName, err)
	}

	// 转换为fscan内部格式
	poc, err := universalPoc.ToFscanPoc()
	if err != nil {
		return nil, fmt.Errorf("%s %s: %w", i18n.GetText("webscan_poc_convert_failed"), fileName, err)
	}

	return poc, nil
}

// LoadPoc 从内嵌文件系统加载单个POC
func LoadPoc(fileName string, Pocs embed.FS) (*Poc, error) {
	// 读取POC文件内容
	yamlFile, err := Pocs.ReadFile("pocs/" + fileName)
	if err != nil {
		return nil, fmt.Errorf("%s %s: %w", i18n.GetText("webscan_poc_file_read_failed"), fileName, err)
	}

View on GitHub (pinned to 95cc12e753)