shadow1ng/fscan · error
webscan_rulemap_key_invalid
webscan_rulemap_key_invalid
Error message
webscan_rulemap_key_invalid
What it means
Guard in RuleMap.UnmarshalYAML: a key in the ordered YAML mapping could not be asserted to string (non-scalar or complex key). The rule map requires string keys mapping to rule lists, so decoding fails on the offending entry.
Source
Thrown at webscan/lib/Client.go:338
// - error: 解析错误
func (r *RuleMap) UnmarshalYAML(unmarshal func(interface{}) error) error {
// 使用MapSlice保持键的顺序
var tmp1 yaml.MapSlice
if err := unmarshal(&tmp1); err != nil {
return err
}
// 解析规则内容
var tmp = make(map[string][]Rules)
if err := unmarshal(&tmp); err != nil {
return err
}
// 按顺序转换为RuleMap结构
for _, one := range tmp1 {
key, ok := one.Key.(string)
if !ok {
return fmt.Errorf("%s", i18n.GetText("webscan_rulemap_key_invalid"))
}
value := tmp[key]
*r = append(*r, RuleItem{key, value})
}
return nil
}
// UnmarshalYAML 实现ListMap的YAML解析接口
// 参数:
// - unmarshal: YAML解析函数
//
// 返回:
// - error: 解析错误
func (r *ListMap) UnmarshalYAML(unmarshal func(interface{}) error) error {
// 解析YAML映射
var tmp yaml.MapSlice
if err := unmarshal(&tmp); err != nil {
return errView on GitHub (pinned to 95cc12e753)
Solutions
- Ensure all keys in the rules map are plain strings
- Remove YAML complex keys (e.g. sequences as keys)
- Fix or drop the malformed POC rule file
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at webscan/lib/Client.go:338 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/63a96c127cba3c0a.
Report an issue: GitHub.