Closed Danrancan closed 7 months ago
Hi @Danrancan, try this:
SecRule REQUEST_FILENAME "@streq /" \
"id:1044,\
phase:1,\
pass,\
t:none,\
nolog,\
ctl:ruleRemoveTargetById=932236;ARGS_NAMES:wc-ajax"
Your exclusion rule doesn't work because you used REQUEST_URI
variable which, in this case, is /?wc-ajax=add_to_cart
and not only /
.
Note: Never exclude rule 949110 (or any 949XXX) because you will completely disable firewall with it - this is a blocking rule.
This worked! Thank you again @azurit! Also, thank you for the tip about never excluding rule 949xxx
. But to enhance my knowledge and help me with further rule exclusions, how were you able to tell that the REQUEST_URI
is /?wc-ajax=add_to_cart
? I thought the REQUEST_URI
is just the [uri "/"]
found in the logs? If that is not the case, then what exactly does [uri "/"]
indicate in the logs? What is that telling me?
Thanks again friend!
@Danrancan It is a REQUEST_FILENAME, see the docs: REQUEST_FILENAME REQUEST_URI
Description
I am running a live Woocommerce Wordpress website. If you go to https://www.mcmo.xyz/shop/ and click on the "add to cart" button embedded in on of the items, the button does nothing and is blocked by Modsecurity. For the life of me, I cannot figure out the proper rule exclusion for these buttons to work properly. So far, my non-working rule exclusions look like this:
If anyone could please help me figure out the proper rules exclusions here, it would be greatly appreciated. I am still a noob and just learning RE's, so any help would be great.
How to reproduce the misbehavior (-> curl call)
I don't know how to submit curl requests. But if you go to https://www.mcmo.xyz/shop/ and try to add one of the items to your cart, you won't be able to add anything to your card.
Logs
Your Environment
Confirmation
[X ] I have removed any personal data (email addresses, IP addresses, passwords, domain names) from any logs posted.