OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP...

19
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP Foundation OWASP http://www.owasp.org Ασυαλής Ανάπτυξη Λογισμικού: Οι κίνδυνοι μέσα από το OWASP Top 10 Konstantinos Papapanagiotou Chapter Leader OWASP Greek Chapter [email protected] ΣΥΝΕΔΡΙΟ ΕΛΛΑΚ 2010 15/5/2010

Transcript of OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP...

Page 1: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

Copyright © The OWASP FoundationPermission is granted to copy, distribute and/or modify this document under the terms of the OWASP License.

The OWASP Foundation

OWASP

http://www.owasp.org

Ασυαλής Ανάπτυξη Λογισμικού: Οι κίνδυνοι μέσα από το OWASP Top 10

Konstantinos Papapanagiotou

Chapter Leader

OWASP Greek Chapter

[email protected]

ΣΥΝΕΔΡΙΟ ΕΛΛΑΚ 201015/5/2010

Page 2: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

2

Page 3: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application
Page 4: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

Code

Page 5: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

Your Code is Part of Your Security Perimeter

APPLICATIONATTACK

You can’t use network layer protection (firewall, SSL, IDS, hardening)to stop or detect application layer attacks

Your security “perimeter” has huge holes at the application layer

5

Page 6: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

The Open Web Application Security Projecthttp://www.owasp.org

http://www.owasp.gr – http://blog.owasp.gr

Page 7: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application
Page 8: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

Risk

Page 9: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

OWASP Top 10 Risk Rating Methodology

1.66 weighted risk rating

Injection Example

1

2

3

9

Page 10: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

OWASP Top Ten (2010 Edition)

A1: InjectionA2: Cross-Site Scripting (XSS)

A3: Broken Authentication

and Session Management

A4: Insecure Direct Object References

A5: Cross Site Request Forgery

(CSRF)

A6: Security Misconfiguration

A7: Failure to Restrict URL

Access

A8: Insecure Cryptographic

Storage

A9: Insufficient Transport Layer

Protection

A10: Unvalidated

Redirects and Forwards

http://www.owasp.org/index.php/Top_10

10

Page 11: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

A1. Injection

APPLICATION

ATTACK

HTTP

request

SQL

query

DB Table HTTP

response

"SELECT * FROM

accounts WHERE

acct=‘’ OR 1=1--

’"

1. Application presents a form to

the attacker

2. Attacker sends an attack in the

form data

3. Application forwards attack to

the database in a SQL query

Account Summary

Acct:5424-6066-2134-4334

Acct:4128-7574-3921-0192

Acct:5424-9383-2039-4029

Acct:4128-0004-1234-0293

4. Database runs query containing

attack and sends encrypted results

back to application

5. Application decrypts data as

normal and sends results to the user

Account:

SKU:

Account:

SKU:

11

Page 12: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

A2. Cross-Site Scripting (XSS)

Application with stored XSS vulnerability

3

2

Attacker sets the trap – update my profile

Attacker enters a malicious script into a web page that stores the data on the server

1

Victim views page – sees attacker profile

Script silently sends attacker Victim’s session cookie

Script runs inside victim’s browser with full access to the DOM and cookies

12

Page 13: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

A3. Broken Authentication1 User sends credentials

2Site uses URL rewriting

(i.e., put session in URL)

3 User clicks on a link to http://www.hacker.com

in a forum

www.boi.com?JSESSIONID=9FA1DB9EA...

4

Hacker checks referer logs on www.hacker.com

and finds user’s JSESSIONID

5 Hacker uses JSESSIONID

and takes over victim’s

account

13

Page 14: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

A5. Cross-Site Request Forgery (CSRF)

3

2

Attacker sets the trap on some website on the internet

(or simply via an e-mail)1

While logged into vulnerable site,

victim views attacker site

Vulnerable site sees

legitimate request from

victim and performs the

action requested

<img> tag loaded by

browser – sends GET

request (including

credentials) to vulnerable

site

Hidden <img> tag

contains attack against

vulnerable site

Application with CSRF

vulnerability

15

Page 15: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

Software Development Lifecycle

19

Page 16: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

OWASP

CurrentPractice:

Penetrationtesting

Page 17: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

http://www.opensamm.org/

Page 18: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

Ohana

Page 19: OWASP Top 10 - conf.ellak.gr · OWASP A1. Injection APPLICATION ATTACK HTTP request SQL query HTTP DB Table response "SELECT * FROM accounts WHERE acct=‘’ OR 1=1--’" 1. Application

http://blog.owasp.grhttp://www.owasp.gr

Thank You