{"record":{"id":"7f89c18441123191","repo":"shadow1ng/fscan","slug":"s-webscan-afrog-no-rules","errorCode":null,"errorMessage":"%s (webscan_afrog_no_rules)","messagePattern":"(.+?) \\(webscan_afrog_no_rules\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"webscan/lib/poc_adapter.go","lineNumber":599,"sourceCode":"\t\t\tFollowRedirects: rule.Request.FollowRedirects,\n\t\t\tExpression:      rule.Expression,\n\t\t}\n\n\t\t// 转换 output 字段为 Search — 多步POC中从响应提取变量供后续步骤使用\n\t\tif searchVal, ok := rule.Output[\"search\"]; ok {\n\t\t\tfscanRule.Search = fmt.Sprintf(\"%v\", searchVal)\n\t\t}\n\n\t\t// 如果expression为空，默认检查200状态码\n\t\tif fscanRule.Expression == \"\" {\n\t\t\tfscanRule.Expression = \"response.status == 200\"\n\t\t}\n\n\t\tpoc.Rules = append(poc.Rules, fscanRule)\n\t}\n\n\tif len(poc.Rules) == 0 {\n\t\treturn nil, fmt.Errorf(\"%s\", i18n.GetText(\"webscan_afrog_no_rules\"))\n\t}\n\n\treturn poc, nil\n}\n","sourceCodeStart":581,"sourceCodeEnd":604,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/webscan/lib/poc_adapter.go#L581-L604","documentation":"The afrog ToFscanPoc conversion throws webscan_afrog_no_rules when, after iterating the afrog POC's payloads/rules, no fscan rules could be generated. Returning an empty-rules POC would be useless, so the converter fails explicitly.","triggerScenarios":"Calling ToFscanPoc on an AfrogPocAdapter whose underlying AfrogPoc has no convertible rule/payload entries — empty sets, unsupported expression syntax, or missing rule sections.","commonSituations":"Afrog POC templates from incompatible versions whose rule schema changed; POCs with only metadata and an expression the converter can't translate; programmatically built AfrogPoc without populating rules.","solutions":["Ensure the afrog POC contains a populated rules/sets section before conversion","Check the converter's supported expression constructs and simplify unsupported ones","Skip or flag POCs that yield zero rules instead of assuming conversion always succeeds","Update the POC source to a version compatible with this library's converter"],"exampleFix":"// before\nrules, err := adapter.ToFscanPoc()\n// after\nif len(adapter.Poc.Rules) == 0 {\n    return // nothing convertible\n}\nrules, err := adapter.ToFscanPoc()","handlingStrategy":"validation","validationCode":"if len(afrogPoc.Rules) == 0 {\n    return errors.New(\"afrog POC has no convertible rules\")\n}","typeGuard":"func hasAfrogRules(a *lib.AfrogPocAdapter) bool {\n    return a != nil && len(a.Poc.Rules) > 0\n}","tryCatchPattern":"poc, err := adapter.ToFscanPoc()\nif err != nil && strings.Contains(err.Error(), \"webscan_afrog_no_rules\") {\n    log.Warnf(\"skipping POC %s: no rules\", adapter.GetName())\n    return nil\n}","preventionTips":["Filter your afrog POC set to templates with populated rule sections before conversion","Dry-run batch conversion and report POCs yielding zero rules","Track afrog schema changes when updating POC repos","Only execute POCs confirmed to have rules"],"tags":["poc","conversion","afrog"],"backgroundTag":"empty-result-set","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}