0

I have these rules :

SecRule REQUEST_URI "@rx ^/(.*)$" \
    "id:94000001,phase:1,t:none,nolog,pass,\
    ctl:ruleRemoveById=933120,\
    ctl:ruleRemoveById=933150,\
    ctl:ruleRemoveById=920210,\
    ctl:ruleRemoveById=931100,\
    ctl:ruleRemoveById=920600,\
    ver:'wordpress-exception/1'"

To allow this request to be accepted by server but, it always get blocked by the rules of 920600

Here is the request :

curl -H "Accept: text/htmlapplication/xhtml+xmlapplication/xml;q=0.9*/*q=0.8" "http://example.com/abc

Spesification : Apache2 CRS Version : 4.3.0

I would appreciate any suggestion.

4
  • CRS dev-on-duty here. Can you please share the logs, where I see what's getting blocked? I don't have enough info to help you. Commented Jun 28 at 7:58
  • Hi @franbuehler here is the link : gist.github.com/navotera/cc500062a351c675492b3152ac979c17
    – navotera
    Commented Jun 28 at 8:20
  • Thank you for providing the log. This is the debug log with lots of info. Do you have an error.log, where I see the matched rules only? Commented Jun 28 at 9:16
  • Hi @franbuehler I have update the gist on the top to show the error log
    – navotera
    Commented Jun 28 at 12:33

1 Answer 1

2

CRS dev-on-duty here. Thank you for providing the logs. As you have already spotted, you have a problem with OWASP CRS rule 920600 that checks for Illegal Accept header: charset parameter.

Your Accept header in your curl request seems to be broken. It seems that white spaces, , and ; are missing.

This is your Accept header: text/htmlapplication/xhtml+xmlapplication/xml;q=0.9*/*q=0.8

And this is a valid Accept header: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8

Where does your Accept header come from? It's better to fix this Accept header than disabling the rule.

But if you still need to disable this rule, you can do so by adding the following directive AFTER including the OWASP CRS rules (rules/*.conf): SecRuleRemoveById 920600.

In case you need further guidance on how to tune your OWASP CRS rules, please have a look at our documentation: https://coreruleset.org/docs/concepts/false_positives_tuning/

3
  • seems like I have add the order of this rules AFTER the crs/rules/*.conf is loaded. It should be added before that. However, I am not really sure about the order, why does other rules work without any issue in my custom rules? only 920600 that does not work?
    – navotera
    Commented Jun 29 at 2:38
  • What rules are you talking of when you say "this rules"? My proposed directive SecRuleRemoveById is the right way to always remove this rule and it should be placed AFTER the CRS rules include. Also see the linked docs please. Commented Jun 29 at 14:57
  • Thank you for you information Fran Seems like if user wrongly place the order of the custom rules some of it will work some not.
    – navotera
    Commented Jul 6 at 3:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .