{"record":{"id":"3a14bb9406bf0a04","repo":"shadow1ng/fscan","slug":"webscan-strmap-parse-failed","errorCode":"webscan_strmap_parse_failed","errorMessage":"webscan_strmap_parse_failed","messagePattern":"webscan_strmap_parse_failed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"webscan/lib/Client.go","lineNumber":307,"sourceCode":"\t\tKey   string  // 键名\n\t\tValue []Rules // 规则列表\n\t}\n)\n\n// UnmarshalYAML 实现StrMap的YAML解析接口\nfunc (r *StrMap) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t// 临时使用MapSlice存储解析结果\n\tvar tmp yaml.MapSlice\n\tif err := unmarshal(&tmp); err != nil {\n\t\treturn err\n\t}\n\n\t// 转换为StrMap结构\n\tfor _, one := range tmp {\n\t\tkey, keyOk := one.Key.(string)\n\t\tvalue, valueOk := one.Value.(string)\n\t\tif !keyOk || !valueOk {\n\t\t\treturn fmt.Errorf(\"%s\", i18n.GetText(\"webscan_strmap_parse_failed\"))\n\t\t}\n\t\t*r = append(*r, StrItem{key, value})\n\t}\n\n\treturn nil\n}\n\n// UnmarshalYAML 实现RuleMap的YAML解析接口\n// 参数：\n//   - unmarshal: YAML解析函数\n//\n// 返回：\n//   - error: 解析错误\nfunc (r *RuleMap) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t// 使用MapSlice保持键的顺序\n\tvar tmp1 yaml.MapSlice\n\tif err := unmarshal(&tmp1); err != nil {\n\t\treturn err","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/webscan/lib/Client.go#L289-L325","documentation":"Guard in StrMap.UnmarshalYAML: while converting the ordered YAML mapping, a key or value was not a string (e.g. a nested map or number where a string was expected). The POC rule field being decoded does not match the string-to-string map shape and parsing is aborted.","triggerScenarios":"Thrown at webscan/lib/Client.go:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the POC YAML so map values are plain strings","Quote numeric or boolean values in the rule map","Validate the POC file against the documented schema"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}