WAF Content filtering

What is the name of the domain?

example.com

What is the issue you’re encountering

Not being able to block injections at one form and attacker is trying to inject code

What steps have you taken to resolve the issue?

Using WAF Filtering with no success.
Thinking about using mod_security at server level, but don’t know if it would work.

What are the steps to reproduce the issue?

We have been suffering from code injection at a Magento store.

A user without registering fills and order and injects code at several fields (name, address, …).

With mod_security we would use such rules:
SecRule ARGS|ARGS_GET|ARGS_POST|REQUEST_BODY “@contains {IFS%??}pub;curl$” “id:103,phase:2,t:none,t:lowercase,deny,status:403,log,msg:‘SPAM Not allowed’”
SecRule ARGS|ARGS_GET|ARGS_POST|REQUEST_BODY “@contains curl${IFS” “id:104,phase:2,t:none,t:lowercase,deny,status:403,log,msg:‘SPAM Not allowed’”

But with Cloudflare we don’t know how to do it.
We have PRO Plan. Don’t know if anything better is needed.

Also, would able to deploy such rules at mod_security despite Cloudflare?

Thank you!

From my understanding of the mod_security rules from above, could be oversight, may I ask if you’re trying to block, rather to show a 403 page for anyone trying to sent a HTTP request (POST) onto your <form> element where the user-agent contains curl? :thinking:

Or rather checking what’s being sent via BODY? :thinking:

May I ask if Managed Rules are active?

Furthermore, Have you tried enabling and tuning any of the Managed Rules for Magento and/or additional ones particularly for CSRF/XSS as well? :thinking:

May I ask have you tried creating and applying any Custom Rules as well? :thinking:

Sure! I have all them enabled and mostly all them are active.

Regarding custom rules, I don’t know how to block content forms as stated at mod_security conf.

I tried everything. This is why I am asking for help. A little desperate.

I appreciate a lot your response! Thank you very much!

1 Like

This topic was automatically closed after 15 days. New replies are no longer allowed.