Increase security in .htaccess

Discussion regarding Joomla! 1.5 security issues.
Joomla! Vulnerable Extensions: http://feeds.joomla.org/JoomlaSecurityV ... Extensions

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
Slackervaara
Joomla! Ace
Joomla! Ace
Posts: 1115
Joined: Sat Aug 13, 2011 6:27 am

Increase security in .htaccess

Post by Slackervaara » Tue Jun 04, 2013 4:19 am

I have been thinking about increasing security of .htaccess and stopping SQL-injection. Today I found this suggestion for htaccess:

RewriteCond %{QUERY_STRING} .*jos_.* [NC,OR]

http://www.webmaster-forums.net/web-pro ... ase-advise

Grateful for input!

User avatar
Slackervaara
Joomla! Ace
Joomla! Ace
Posts: 1115
Joined: Sat Aug 13, 2011 6:27 am

Re: Increase security in .htaccess

Post by Slackervaara » Mon Jun 10, 2013 5:46 pm

I have now added it to .htaccess after this statement:
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

The site seems to work normally and I hope to get extra protection against sql-injection.

User avatar
PhilD
Joomla! Hero
Joomla! Hero
Posts: 2737
Joined: Sat Oct 21, 2006 10:20 pm
Location: Wisconsin USA
Contact:

Re: Increase security in .htaccess

Post by PhilD » Mon Jun 10, 2013 8:51 pm

So your experiments with the Suggested master htaccess file http://docs.joomla.org/Htaccess_example ... ccess_file
and specifically this within the file to help prevent sql injections did not work?

Code: Select all

## SQLi first line of defense, thanks to Radek Suski (SigSiu.net) @
## http://www.sigsiu.net/presentation/fortifying_your_joomla_website.html
## May cause problems on legitimate requests
RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC]
RewriteRule .* - [F]
PhilD

User avatar
Slackervaara
Joomla! Ace
Joomla! Ace
Posts: 1115
Joined: Sat Aug 13, 2011 6:27 am

Re: Increase security in .htaccess

Post by Slackervaara » Tue Jun 11, 2013 3:57 pm

It is recommended to change the jos_ prefix to something else and as I have not done that I want to add this jos_ entry in htaccess as extra protection.


Locked

Return to “Security in Joomla! 1.5”