Support

Admin Tools

#22637 mod_security dissabled

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by bobpit on Monday, 18 May 2015 10:36 CDT

bobpit
I had problems viewing the site. After contacting the host support I received the following message:
>>>>>>>>>>>>>>>>>>>>>>>
=========
...I could see that causing for this issue is blocking rules of mod_security. please have a look in the below snippet.

2015-05-17 16:25:14.558 [NOTICE] [122.172.170.122:59599-2#APVH_nemeangames.soultherapynow.com] mod_security rule triggered!
[Sun May 17 16:25:14 2015] [error] [client 122.172.170.122] ModSecurity: Access denied with code 403, [Rule: 'ARGS_NAMES|ARGS|XML:/*' '(?i:[\s'\"`\(\)]*?)([\d\w]++)([\s'\"`\(\)]*?)(?:(?:=|<=>|r?like|sounds\s+like|regexp)([\s'\"`\(\)]*?)\2|(?:!=|<=|>=|<>|<|>|\^|is\s+not|not\s+like|not\s+regexp)([\s'\"`\(\)]*?)(?!\2)([\d\w]+)))'] [id "950901"] [msg "SQL Injection Attack: SQL Tautology Detected."]
=========

I have disabled the mod_security for your account for permanently resolve this issue.
<<<<<<<<<<<<<<<<<<<<<

Should I be worried now that mod_security is disabled for my shared hosting account?

nicholas
Akeeba Staff
Manager
They don't have to disable mod_security2 in its entirety. The can just disable this particular rule which is a bit too broad. I suspect this rule causes similar problems to other sites.

As a matter of security policy I prefer mod_security2 to be enabled. If it's not enabled it doesn't mean that your site will be automatically hacked, but it's a bit easier. So maybe contact your host and ask them to disable the offending rule instead of mod_security2 as a whole?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

bobpit
Hello Nicholas

You are right, even some static sites in the same account were affected.

I asked the host to disable just this rule for my account. This is their answer:
"Unfortunately rules works server wide, can't be apply per account or per domain."

I have also not seen any settings for specific rules in cpanel. Either I enable or disable mod_security, for each of my domains.

Have the host understood correctly? Should I leave mod_security disabled?

I am thinking, what could really be the problem? All of a sudden all my sites were not working when I visited them. Other times they were working. I was certain it was low resources on the server...

nicholas
Akeeba Staff
Manager
Your host is right that the rules are server wide. What I'm saying is that this rule is bound to cause problems. If they don't want to change the rule you have the following options:

1. Live with it. You have Admin Tools installed. As long as you don't use any extensions or scripts which require direct web access, bypassing Joomla!, you're mostly fine.

2. Upgrade to a VPS. A VPS is a virtual private server so it is possible to change which mod_security2 rules will be applied on the entire VPS.

3. Go to another host. However, unless you go for a VPS it is more than likely that you'll have the exact same problem.

Out of the three possibilities I think that the second one, going for a VPS, is the best.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

bobpit
I prefer option #1. However please explain, should I live with mod_security enabled (and the site going down sometimes), or mod_security disabled and have a little less security?

>>>
As long as you don't use any extensions or scripts which require direct web access, bypassing Joomla!, you're mostly fine.
<<<
I don't _think_ I have any of those. Plus I have several static sites. So this means that I do need or that I do NOT need mod_security enabled?

>>>
What I'm saying is that this rule is bound to cause problems.
<<<
I understand. So I am surprised that they keep it, doesn't it affect other shared accounts?

nicholas
Akeeba Staff
Manager
> I don't _think_ I have any of those. Plus I have several static sites. So this means that I do need or that I do NOT need mod_security enabled?

Practically, you have no use for it with static sites. It really makes sense for dynamic sites. Since your dynamic sites are all Joomla! and don't use directly accessible .php scripts you can live without it.

Bottom line: I wouldn't lose sleep over it. However, if you can find out which page on your site triggers this rule and how to avoid triggering it then re-enabling mod_security2 is a good idea. mod_security2 is yet another speedbump to slow down attackers. You can never have too much security, right?

> I understand. So I am surprised that they keep it, doesn't it affect other shared accounts?

Apparently the policy is "if it causes problems disable mod_security2 altogether for the account". It's a simple policy which doesn't require the host techs to understand how mod_security2 rules work (it is REALLY DAMN HARD!) and the security impact is not enough to lose sleep over. Plus, it makes dead simple updating the rules from one of the published rulesets, e.g. OWASP or Atomic, without requiring a very expensive technician going over them manually. It does make sense. Very few hosts have the scale required for a custom rules policy to be sustainable.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

bobpit
>>>
if you can find out which page on your site triggers this rule and how to avoid triggering it then re-enabling mod_security2 is a good idea.
<<<
Is there an EASY way to find out? What log should I look at?

bobpit
BTW, I don;t know if it is related, but in the last 4 hours I got more than 10 exceptions of this type:

Reason: tmpl= in URL

Could it be related? I did not have many exceptions before.

nicholas
Akeeba Staff
Manager
Your host should be able to tell you which URL triggered the mod_security2 rule. You can then take a look at your menus to figure out which component it comes from.

As for the tmpl= warnings, please read the documentation. You most likely have to enable the "Allow site templates" option if you're using Joomla!'s Send by Email buttons on your site. Why and how is documented.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

bobpit
Maybe it was just a coincidence. I was alarmed because those tmpl= warnings were not that common before the disabling of mod_security.

Thank you Nicholas.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!