{"record":{"id":"74655cad87f399e1","repo":"crowdsecurity/crowdsec","slug":"unknown-body-type-s","errorCode":null,"errorMessage":"unknown body type '%s'","messagePattern":"unknown body type '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/appsec/appsec_rule/modsecurity.go","lineNumber":397,"sourceCode":"\tfor _, transform := range rule.Transform {\n\t\tif transform == \"\" || (hasCount && transform == \"count\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tr.WriteByte(',')\n\n\t\tmappedTransform, ok := transformMap[transform]\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"unknown transform '%s'\", transform)\n\t\t}\n\n\t\tr.WriteString(mappedTransform)\n\t}\n\n\tif rule.BodyType != \"\" {\n\t\tmappedBodyType, ok := bodyTypeMatch[rule.BodyType]\n\t\tif !ok {\n\t\t\treturn \"\", fmt.Errorf(\"unknown body type '%s'\", rule.BodyType)\n\t\t}\n\n\t\tr.WriteString(fmt.Sprintf(\",ctl:requestBodyProcessor=%s\", mappedBodyType))\n\t}\n\n\tif opts.chain {\n\t\tr.WriteString(\",chain\")\n\t}\n\n\tif opts.skip > 0 {\n\t\tr.WriteString(fmt.Sprintf(\",skip:%d\", opts.skip))\n\t}\n\n\tr.WriteByte('\"')\n\n\treturn r.String(), nil\n}\n","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/appsec/appsec_rule/modsecurity.go#L379-L415","documentation":"rule.BodyType has no entry in bodyTypeMatch (body-type→ctl:requestBodyProcessor mapping, e.g. json, xml). The custom rule requests a request-body processor the converter cannot declare via the ctl action.","triggerScenarios":"Thrown at pkg/appsec/appsec_rule/modsecurity.go:397 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set body_type to a documented value (json, xml, urlencoded) or remove it","Check the version's bodyTypeMatch for the supported set"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}