magento worst practice (meet magento poland 2016)

51
Andreas von Studnitz - @avstudnitz Andreas von Studnitz Magento Worst Practice

Upload: andreas-von-studnitz

Post on 14-Apr-2017

374 views

Category:

Internet


3 download

TRANSCRIPT

Page 1: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Andreas von Studnitz

Magento Worst Practice

Page 2: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Andreas von Studnitz

Magento Worst Practice

Andreas von Studnitz

Magento since 2008

Developer, Consultant,

Trainer

Co-Founder integer_net

Aachen, Germany

Page 3: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Problems

Page 4: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Small Problems • Bad code quality

• Low performance

• Conflicting modules

• Hard to update

Small Problems

Page 5: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Small Problems

• Outdated Magento version

• Not patched

• Conflicting modules

• Low performance

• Hard to update

Page 6: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 7: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Real™ Problems:

Security

Page 8: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 9: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

17/11/2015

Page 10: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Customer data and passwords

stolen

lib/Varien/Object.php:

Page 11: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Usernames and passwords stolen

Page 12: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Site hacked / encrypted

Page 13: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 14: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10

Worst Magento

Practices

Page 15: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#10 Downloadable Code

Page 16: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Protect your .git folder

(if you have any)

Page 17: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Don‘t put your code on GitHub

unprotected!

Page 18: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#9 Downloadable Data

Page 19: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 20: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

email address, name,

company, password

(hashed), order items

(1264 lines)

Full (outdated)

database dump

Page 21: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

But if you don’t know the filename,

these issues cannot be exploited!

http://www.seochat.com/c/a/

google-optimization-help/hiding-

your-sensitive-data-from-google-

and-the-world/

http://securityxploded.com/

bruteforcing-filenames-on-

webservers-using-dirbuster.php

?

Page 22: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Don‘t put your database dumps

on GitHub!

Page 23: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Please!

Page 24: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#8 Unprotected

Executables

Page 25: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Import script;

triggers reindexing

Imports database from file

Page 26: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

• Don’t call your scripts from the browser –

use the shell instead

• Put your executables into “shell” instead of

the main directory

• Remove unneeded scripts

Page 27: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#7 Unprotected

Database Credentials

Page 28: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Don‘t remove the protection of

app/etc/local.xml!

Page 29: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Don‘t put your

local.xml on GitHub!

Page 30: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#6 Unsecured Admin

Page 31: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

• Don’t use the default admin username /

password

• Don’t use common usernames and

passwords

• Change the admin URL

• Remove the Magento Connect Manager

(“downloader”)

Page 32: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#5 Unsecured Tools

Page 33: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Don‘t leave your management

tools unprotected!

Update your tools!

Page 34: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#4 Patches not applied

Page 35: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Example: Shoplift Bug

(patched February 2015)

Page 36: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

50,581

Source: byte.nl, April 2016

Magento shops vulnerable to Shoplift:

(out of 255,558)

Page 37: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#3 Insecure Modules

Page 38: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 39: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#2 Database Tools

Page 40: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 41: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

If you have a DB management tool freely accessible,

at least pre-fill access data!

</irony>

Page 42: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#1

Page 43: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 44: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 45: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

No comment.

Page 46: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Top 10 Worst Magento Practices

#1 Backdoors

Page 47: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

That‘s it?

Yes.

For now.

Looking for more examples

Page 48: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Real™ Problems: • Stolen user data

• Stolen payment data

• Server misused by hackers

• Server unavailable

• Server hold to ransom

Page 49: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Security Basics • “Security by Obscurity” doesn’t work

• Keep your stuff up to date

• Stay informed

• For all freely accessible files, double check

if they can be misused

• Don’t trust easily

• Do code reviews!

• Recommendation: www.magereport.com

Page 50: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Page 51: Magento Worst Practice (Meet Magento Poland 2016)

Andreas von Studnitz - @avstudnitz

Thank you!

PHOTO

Please contact me!

@integer_net www.integer-net.com

@avstudnitz [email protected]