Skip to content

SecPcreMatchLimit and SecPcreMatchLimitRecursion not follwed in modsecurity.conf #1290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Dec 20, 2016 · 3 comments
Closed
Assignees

Comments

@ghost
Copy link

ghost commented Dec 20, 2016

I compiled ModSecurity v2.9.0 with no options (ie ./configure) and found that later I was having PCRE match issues, so I increased the values in modsecurity.conf (httpd/conf.d/ folder) and found that it was have 0 effect. After troubleshooting for a few hours, I recompiled with higher values and that resolved the issue (ie ./configure --enable-pcre-match-limit=200000 --enable-pcre-match-limit-recursion=200000).

So the bug is that the conf file options dont work.

@bostrt
Copy link

bostrt commented May 27, 2017

@BP9906 It looks like you will need to build with the PCRE_EXTRA_MATCH_LIMIT and PCRE_EXTRA_MATCH_LIMIT_RECURSION macro:

https://github.com/SpiderLabs/ModSecurity/blob/v2/master/apache2/msc_pcre.c#L89-L96
https://github.com/SpiderLabs/ModSecurity/blob/v2/master/apache2/msc_pcre.c#L108-L115

@surnamedd
Copy link

surnamedd commented Nov 6, 2017

The values in modsecurity.conf is part of the RegEx DoS rule, like:
SecPcreMatchLimit 10000
SecPcreMatchLimitRecursion 10000
SecRule TX:/^MSC_/ "!@Streq 0"
"id:'200004',phase:2,t:none,deny,msg:'ModSecurity internal error flagged:
%{MATCHED_VAR_NAME}'"

@zimmerle zimmerle self-assigned this Nov 6, 2017
@zimmerle
Copy link
Contributor

zimmerle commented Nov 6, 2017

Keep in mind that Apache/PCRE will honor the last module that set those limits, as the process share the same configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants