In ModSecurity there are PCRE limits exceeded
errors.
I know I can fix this by setting rules such as:
SecPcreMatchLimit 150000
SecPcreMatchLimitRecursion 150000
But, what are these rules actually doing? What does the PCRE limit recursion set to 150,000 mean? What security holes am I allowing through by setting these so high? What does the recursion
and limit
mean?
I know there is documentation, but the documentation doesn't actually tell me what is going on, it simply tells me how to work with the directives.
These appear to be settings internal to the PCRE engine in order to limit the maximum amount of memory/time spent on trying to match some text to a pattern. The
pcreapi
manpage does little to explain it in layman's terms:Since the PCRE library built-in default is 10000000, my guess is that the lower setting is suggested for mod_security in order to prevent requests from being held up for a long time.
The values you see inside mod_security.conf are part of a RegEx DoS rule: