{"record":{"id":"36b9c6cb27d56747","repo":"shadow1ng/fscan","slug":"webscan-listmap-key-invalid","errorCode":"webscan_listmap_key_invalid","errorMessage":"webscan_listmap_key_invalid","messagePattern":"webscan_listmap_key_invalid","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"webscan/lib/Client.go","lineNumber":363,"sourceCode":"\n// UnmarshalYAML 实现ListMap的YAML解析接口\n// 参数：\n//   - unmarshal: YAML解析函数\n//\n// 返回：\n//   - error: 解析错误\nfunc (r *ListMap) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\t// 解析YAML映射\n\tvar tmp yaml.MapSlice\n\tif err := unmarshal(&tmp); err != nil {\n\t\treturn err\n\t}\n\n\t// 转换为ListMap结构\n\tfor _, one := range tmp {\n\t\tkey, keyOk := one.Key.(string)\n\t\tif !keyOk {\n\t\t\treturn fmt.Errorf(\"%s\", i18n.GetText(\"webscan_listmap_key_invalid\"))\n\t\t}\n\n\t\tvalueSlice, valueOk := one.Value.([]interface{})\n\t\tif !valueOk {\n\t\t\treturn fmt.Errorf(\"%s\", i18n.GetText(\"webscan_listmap_value_invalid\"))\n\t\t}\n\n\t\tvar value []string\n\t\t// 将接口类型转换为字符串\n\t\tfor _, val := range valueSlice {\n\t\t\tv := fmt.Sprintf(\"%v\", val)\n\t\t\tvalue = append(value, v)\n\t\t}\n\t\t*r = append(*r, ListItem{key, value})\n\t}\n\treturn nil\n}\n","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/webscan/lib/Client.go#L345-L381","documentation":"Guard in ListMap.UnmarshalYAML: a key in the ordered YAML mapping failed the string assertion. ListMap requires string keys paired with string-list values, so a non-string key aborts decoding of the POC structure.","triggerScenarios":"Thrown at webscan/lib/Client.go:363 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make all list-map keys scalar strings","Quote keys that look like numbers or booleans","Correct the offending POC YAML file"],"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-14T00:17:10.932Z"}