{"record":{"id":"84d47b1796c61ce7","repo":"crowdsecurity/crowdsec","slug":"pri-must-be-up-to-3-characters-long","errorCode":null,"errorMessage":"PRI must be up to 3 characters long","messagePattern":"PRI must be up to 3 characters long","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/syslog/internal/parser/rfc3164/parse.go","lineNumber":73,"sourceCode":"\t}\n\n\tr.position++\n\n\tfor r.position < r.len {\n\t\tc := r.buf[r.position]\n\t\tif c == '>' {\n\t\t\tr.position++\n\t\t\tbreak\n\t\t}\n\t\tif c < '0' || c > '9' {\n\t\t\treturn errors.New(\"PRI must be a number\")\n\t\t}\n\t\tpri = pri*10 + int(c-'0')\n\t\tr.position++\n\t}\n\n\tif pri > 999 {\n\t\treturn errors.New(\"PRI must be up to 3 characters long\")\n\t}\n\n\tif r.position == r.len && r.buf[r.position-1] != '>' {\n\t\treturn errors.New(\"PRI must end with '>'\")\n\t}\n\n\tr.PRI = pri\n\treturn nil\n}\n\nfunc (r *RFC3164) parseTimestamp() error {\n\tvalidTs := false\n\tfor _, layout := range VALID_TIMESTAMPS {\n\t\ttsLen := len(layout)\n\t\tif r.position+tsLen > r.len {\n\t\t\tcontinue\n\t\t}\n\t\tt, err := time.Parse(layout, string(r.buf[r.position:r.position+tsLen]))","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/syslog/internal/parser/rfc3164/parse.go#L55-L91","documentation":"Validation in RFC3164 parsePRI: the parsed priority value exceeds 999, i.e. the number inside <...> has more than three digits. RFC 3164 bounds PRI to at most three digits (0-191 meaningfully), so longer values are rejected as malformed.","triggerScenarios":"Thrown at pkg/acquisition/modules/syslog/internal/parser/rfc3164/parse.go:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the sender to emit a valid priority computed as facility*8 + severity (max 191)","Look for a malformed or hand-crafted datagram with a padded/overflowed PRI field"],"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-14T05:17:10.506Z"}