web application security and modern frameworks

41
Platinum Sponsor Kim Leppänen & Leif Åstrand Web Application Security and Modern Frameworks Disclaimer: Highly technical content ahead. Participating in this lecture might change your perspective towards the security of your application. In some cases, listening to this presentation might cause symptoms such as raised awareness of security and general interest towards web application security.

Upload: lastrand

Post on 25-May-2015

395 views

Category:

Software


3 download

DESCRIPTION

Presentation about Rich Internet Application security with GWT and Vaadin. Presented at 33rd Degree 2014 in Krakow.

TRANSCRIPT

Page 1: Web Application Security and Modern Frameworks

Platinum Sponsor

Kim Leppänen & Leif Åstrand

Web Application Security and Modern Frameworks

Disclaimer: Highly technical content ahead. Participating in this lecture might change your perspective towards the security of your application. In some cases, listening to this presentation might cause symptoms such as raised awareness of security and general interest towards web application security.

Page 2: Web Application Security and Modern Frameworks

<script language="javascript">!if ( prompt("Enter password") == "supersecret" ) {!! document.location.href = "secret.html";!}!</script>

Page 3: Web Application Security and Modern Frameworks

OWASP Top 10Open Web Application Security Project

Page 4: Web Application Security and Modern Frameworks

Rich Internet Applications

Page 5: Web Application Security and Modern Frameworks
Page 6: Web Application Security and Modern Frameworks
Page 7: Web Application Security and Modern Frameworks

Client Server

UI logic Business logic

DB

GWT

DOM

Page 8: Web Application Security and Modern Frameworks

Client Server

UI logic

Business logic

DB

Vaadin

DOM

Handled by the framework

Page 9: Web Application Security and Modern Frameworks

A1: Injection

Page 10: Web Application Security and Modern Frameworks

Username demouser

Password ************

String sql = !

! “SELECT * FROM users !

! WHERE !

! ! username=‘“ + request.getParameter(“username”) + “‘ AND!

! ! password=‘“ + request.getParameter(“password”) + “‘“;

Page 11: Web Application Security and Modern Frameworks

!

!

!

String sql = !

! “SELECT * FROM users !

! WHERE !

! ! username=‘demouser‘ AND!

! ! password=‘secretpass‘“;

// username = demouser!

// password = secretpass

Page 12: Web Application Security and Modern Frameworks

// username = demouser’ --!

// password = secretpass!

!

String sql = !

! “SELECT * FROM users !

! WHERE !

! ! username=‘demouser’--‘ AND!

! ! password=‘secretpass‘“;

Page 13: Web Application Security and Modern Frameworks

GWT !

• N/A

Vaadin !• N/A

Web frameworks can help

Page 15: Web Application Security and Modern Frameworks

Session ID fixation !

Exposure of session ID !

Exposing user credentials

Page 16: Web Application Security and Modern Frameworks

GWT !

• N/A

Vaadin !• Helper for changing

session id

Web frameworks can help

Page 17: Web Application Security and Modern Frameworks

A3: Cross-Site Scripting (XSS)

Page 18: Web Application Security and Modern Frameworks

Demo: auction application

Page 19: Web Application Security and Modern Frameworks

GWT !• setText • SafeHtml

Vaadin !• setHtmlContent

Allowed(false) • Beware of tooltips

(setDescription)

Web frameworks can help

Page 20: Web Application Security and Modern Frameworks

Other things to keep in mind

The XSS filter evasion cheat sheet

Context is king

Consider using Markdown

Page 21: Web Application Security and Modern Frameworks

A4: Insecure Direct Object References

Page 22: Web Application Security and Modern Frameworks

GWT !• Not so much, since

this is mostly a server-side thing

• Can be hard to realize the problem since requests are “invisible”

Vaadin !• All ids are

generated values that the server uses to find the right object when needed

Web frameworks can help

Page 23: Web Application Security and Modern Frameworks

A5: Security Misconfiguration

Page 24: Web Application Security and Modern Frameworks

GWT !• N/A

Vaadin !• productionMode =

true

Web frameworks can help

Page 25: Web Application Security and Modern Frameworks

A6: Sensitive Data Exposure

Page 26: Web Application Security and Modern Frameworks

Keep in mind

Avoid handling sensitive data, e.g. credit card numbers

Salt and hash passwords

Use SSL, no excuses!

Page 27: Web Application Security and Modern Frameworks

A7: Missing Function Level Access Control

Page 29: Web Application Security and Modern Frameworks

Banking application example

Account 4059820-440198

Amount 130,00 €

http://your.bank/transfer?account=4059820-440198&amount=130,00

Page 30: Web Application Security and Modern Frameworks

http://your.bank/transfer?account=4059820-440198&amount=130,00

<img src=“

“ />

Page 31: Web Application Security and Modern Frameworks

Creative commons - http://www.flickr.com/photos/esparta/367002402/

Page 32: Web Application Security and Modern Frameworks

You’ve got mail

Creative Commons - http://www.flickr.com/photos/8058853@N06/2685196800/

Page 33: Web Application Security and Modern Frameworks

Your bank

Rogue bank

Page 34: Web Application Security and Modern Frameworks

Banking application example

Account 4059820-440198

Amount 130,00 €

http://your.bank/transfer?account=4059820-440198&amount=130,00 &token=ab8342d8943nkg34iung3o9j

Page 35: Web Application Security and Modern Frameworks

GWT !• GWT-RPC:

XsrfTokenService and/or HasRpcToken

• RequestFactory: Make your own RequestTransport

Vaadin !• Secured out of the

box

Web frameworks can help

Page 36: Web Application Security and Modern Frameworks

A9: Using Components with Known Vulnerabilities

Page 37: Web Application Security and Modern Frameworks

How do you know whether

they are vulnerable?

Page 38: Web Application Security and Modern Frameworks

A10: Unvalidated Redirects and Forwards

Page 39: Web Application Security and Modern Frameworks

<a href=”http://myapp.com?redirect=example.com/evil"> Open app </a>!

Page 40: Web Application Security and Modern Frameworks

Very quick conclusion