From 0314bff2789d8c661c985bf9edc74569efe56ecc Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Wed, 23 Apr 2014 02:35:54 -0400 Subject: [PATCH] Set register_globals=off in .htaccess file and add note to INSTALL --- .htaccess | 27 +++++++++------------------ 1 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.htaccess b/.htaccess index 43ab5b0..9035952 100644 --- a/.htaccess +++ b/.htaccess @@ -10,6 +10,7 @@ php_value post_max_size 6M php_value memory_limit 64M +php_flag register_globals Off php_flag zlib.output_compression Off php_flag magic_quotes_gpc Off php_flag magic_quotes_runtime Off @@ -27,25 +28,15 @@ RewriteEngine On RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico -# security rules -RewriteRule ^/?(\.git|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F] -RewriteRule /?(README(.md)?|composer\.json-dist|composer\.json|package\.xml)$ - [F] +# security rules: +# - deny access to files not containing a dot or starting with a dot +# in all locations except installer directory +RewriteRule ^(?!installer)(\.?[^\.]+)$ - [F] +# - deny access to some locations +RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F] +# - deny access to some documentation files +RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml)$ - [F] </IfModule> - -# deny access to all files not containing a "." (dot) -# to block access to different README, Changelog, INSTALL, etc. -# files of various skins and plugins. -<FilesMatch "^[^\.]+$"> - # Apache 2.4 - <IfModule mod_authz_core.c> - Require all denied - </IfModule> - # Apache 2.2 - <IfModule !mod_authz_core.c> - Order Allow,Deny - Deny from all - </IfModule> -</FilesMatch> <IfModule mod_deflate.c> SetOutputFilter DEFLATE -- Gitblit v1.9.1