What you should do (and maybe you meant it like that) is escape all output. Even here, pay attention to context, htmlescape
is not always the right choice. See also: How to escape output data?How to escape output data?
- If we add Load balancer then piece of code should be added in index.php for http termination Ref Link : Magento wrongly redirects https!Magento wrongly redirects https!
This is a dirty hack that should not be necessary. I recommend setting secure and unsecure base URL to "https" and create a redirect from http urls to https. Here's how to do it with load balancer and ssl termination: Redirect all http:// request to https://Redirect all http:// request to https://
- delete or protect
downloader
directory: http://magento.stackexchange.com/questions/16504/recommended-method-to-protect-downloader/98322?s=2|1.7138#98322https://magento.stackexchange.com/questions/16504/recommended-method-to-protect-downloader/98322?s=2|1.7138#98322 - make sure, the
var
directory is not accessible from the web, as well asapp/etc/local.xml
- same for
.git
composer.json
,composer.lock
- if they exist. They should better not be deployed to production. - disable execution of PHP in
media
to disarm malicious uploads - Keep PHP itself up to date
- Review security of third party extensions, regularly check them for security updates
- regularly run tools like the Magento Malware Scanner and magereport.com
Update: I see, there's a duplicate with a more detailed answer Magento Security Punch listMagento Security Punch list