{"record":{"id":"736182c991d11d9d","repo":"caddyserver/caddy","slug":"too-many-regexp-operations-d-maximum-d-allowed","errorCode":null,"errorMessage":"too many regexp operations: %d (maximum %d allowed)","messagePattern":"too many regexp operations: (.+?) \\(maximum (.+?) allowed\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/logging/filters.go","lineNumber":904,"sourceCode":"\t\t\tf.Operations = append(f.Operations, op)\n\t\tdefault:\n\t\t\treturn d.Errf(\"unrecognized subdirective %s\", d.Val())\n\t\t}\n\t}\n\n\t// Security check: ensure at least one operation is defined\n\tif len(f.Operations) == 0 {\n\t\treturn d.Err(\"multi_regexp filter requires at least one regexp operation\")\n\t}\n\n\treturn nil\n}\n\n// Provision compiles all regexp patterns with security validation.\nfunc (f *MultiRegexpFilter) Provision(ctx caddy.Context) error {\n\t// Security check: validate operation count\n\tif len(f.Operations) > maxRegexpOperations {\n\t\treturn fmt.Errorf(\"too many regexp operations: %d (maximum %d allowed)\", len(f.Operations), maxRegexpOperations)\n\t}\n\n\tif len(f.Operations) == 0 {\n\t\treturn fmt.Errorf(\"multi_regexp filter requires at least one operation\")\n\t}\n\n\tfor i := range f.Operations {\n\t\t// Security validation: pattern length check\n\t\tif len(f.Operations[i].RawRegexp) > maxPatternLength {\n\t\t\treturn fmt.Errorf(\"regexp pattern %d too long: %d characters (maximum %d)\", i, len(f.Operations[i].RawRegexp), maxPatternLength)\n\t\t}\n\n\t\t// Security validation: empty pattern check\n\t\tif f.Operations[i].RawRegexp == \"\" {\n\t\t\treturn fmt.Errorf(\"regexp pattern %d cannot be empty\", i)\n\t\t}\n\n\t\t// Compile and validate the pattern (uses RE2 engine - safe from ReDoS)","sourceCodeStart":886,"sourceCodeEnd":922,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/logging/filters.go#L886-L922","documentation":"Error \"too many regexp operations: %d (maximum %d allowed)\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/logging/filters.go:904 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the number of regexp operations to the allowed maximum."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}