{"record":{"id":"865aa1bac496acca","repo":"shadow1ng/fscan","slug":"webscan-unknown-poc-format","errorCode":"webscan_unknown_poc_format","errorMessage":"webscan_unknown_poc_format: %s","messagePattern":"webscan_unknown_poc_format: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"webscan/lib/poc_adapter.go","lineNumber":133,"sourceCode":"\n\treturn FormatUnknown\n}\n\n// LoadUniversalPoc 加载通用POC（自动识别格式）\nfunc LoadUniversalPoc(filename string, data []byte) (UniversalPoc, error) {\n\tformat := DetectPocFormat(data)\n\n\tswitch format {\n\tcase FormatFscan:\n\t\treturn loadFscanPoc(data)\n\tcase FormatNuclei:\n\t\treturn loadNucleiPoc(data)\n\tcase FormatXray:\n\t\treturn loadXrayPoc(data)\n\tcase FormatAfrog:\n\t\treturn loadAfrogPoc(data)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s: %s\", i18n.GetText(\"webscan_unknown_poc_format\"), filename)\n\t}\n}\n\n// ============= fscan格式适配器 =============\n\n// FscanPocAdapter fscan原生格式适配器\ntype FscanPocAdapter struct {\n\t*Poc\n}\n\nfunc loadFscanPoc(data []byte) (*FscanPocAdapter, error) {\n\tvar poc Poc\n\tif err := yaml.Unmarshal(data, &poc); err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"webscan_fscan_format_parse_failed\"), err)\n\t}\n\treturn &FscanPocAdapter{&poc}, nil\n}\n","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/webscan/lib/poc_adapter.go#L115-L151","documentation":"LoadUniversalPoc dispatches YAML/JSON POC data to a format-specific loader (fscan, nuclei, xray, afrog) based on the detected Format. If the file's format does not match any known adapter, the library rejects it with webscan_unknown_poc_format plus the filename.","triggerScenarios":"LoadUniversalPoc (via parsePocYAML) receives a POC file whose detected format constant is not FormatFscan, FormatNuclei, FormatXray, or FormatAfrog — e.g., an unrecognized YAML schema or a malformed file the format sniffer cannot classify.","commonSituations":"Loading a hand-written or third-party POC in an unsupported schema; a renamed/older format that the sniffer no longer recognizes; passing a non-POC YAML config file to the loader.","solutions":["Convert the POC to one of the supported formats: fscan, nuclei, xray, or afrog.","Check the file's top-level keys against a working example POC of each supported format.","Verify the filename/extension and that the file is actually a POC, not another config.","If the format should be supported, add a Format constant and loader case in poc_adapter.go."],"exampleFix":"// before\n// mypoc.yml uses an unknown custom schema -> webscan_unknown_poc_format\n\n// after\n// convert to nuclei format:\n// id: my-poc\n// info:\n//   name: My Poc\n// http:\n//   - method: GET\n//     path: \"/{{payload}}\"","handlingStrategy":"validation","validationCode":"func looksLikeSupportedPoc(data []byte) bool {\n    var top map[string]interface{}\n    if yaml.Unmarshal(data, &top) != nil { return false }\n    for _, k := range []string{\"rules\", \"id\", \"info\"} {\n        if _, ok := top[k]; ok { return true }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"poc, err := LoadUniversalPoc(path)\nif err != nil {\n    if strings.Contains(err.Error(), \"webscan_unknown_poc_format\") {\n        log.Printf(\"skipping %s: unsupported POC format\", path)\n        return nil // continue batch\n    }\n    return err\n}","preventionTips":["Store POCs only in supported formats: fscan, nuclei, xray, afrog.","Sanity-check top-level keys against example POCs before loading in bulk.","Skip-and-log unknown files when loading a POC directory."],"tags":["poc","yaml","format-detection","unsupported"],"backgroundTag":"unsupported-enum-value","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}