ria security based on owasp top 10€¦ · owasp top 10 open web application security project. rich...

37
Kim Leppänen Leif Åstrand RIA security based on OWASP Top 10

Upload: others

Post on 11-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Kim LeppänenLeif Åstrand

RIA security based on OWASP Top 10

Page 2: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

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

Page 3: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

OWASP Top 10Open Web Application Security Project

Page 4: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Rich Internet Applications

Page 5: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration
Page 6: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration
Page 7: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

1!0 1!1 0 1!1 1 0

Page 8: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Client Server

UI logic Business logic

DB

GWT

DOM

Page 9: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Client Server

UI logic

Business logic

DB

Vaadin

DOM

Handled by the framework

Page 10: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A1: Injection

Page 11: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

“SELECT * FROM Users WHERE username=’” + userNameField.getValue() + “‘“!

Not just SQL - could also be JPQL, HQL, shell, XPath, XML, LDAP, regex, eval, ...

Page 12: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

GWT !

• N/A

Vaadin !• N/A

Web frameworks can help

Page 14: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Session ID fixation !

Exposure of session ID !

Exposing user credentials

Page 15: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

GWT !

• N/A

Vaadin !• Helper for changing

session id

Web frameworks can help

Page 16: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A3: Cross-Site Scripting (XSS)

Page 17: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Demo: auction application

Page 18: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

GWT !• setText • SafeHtml

Vaadin !• setHtmlContentAllo

wed(false) • Beware of tooltips

(setDescription)

Web frameworks can help

Page 19: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Other things to keep in mind

The XSS filter evasion cheat sheet

Context is king

Consider using Markdown

Page 20: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A4: Insecure Direct Object References

Page 21: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

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 22: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A5: Security Misconfiguration

Page 23: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

GWT !• N/A

Vaadin !• productionMode =

true

Web frameworks can help

Page 24: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A6: Sensitive Data Exposure

Page 25: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Keep in mind

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

Salt and hash passwords

Use SSL, no excuses!

Page 26: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A7: Missing Function Level Access Control

Page 28: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

http://example.com/addRole?user=adam&role=power_user

Page 29: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

<img src=”!http://example.com/addRole?user=eve&role=power_user!

“ />

Page 30: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

http://example.com/addRole?user=eve&role=power_user&token=abcd

Page 31: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

GWT !• GWT-RPC:

XsrfTokenService and/or HasRpcToken

• RequestFactory: Make your own RequestTransport

Vaadin !• Secured out of the

box

Web frameworks can help

Page 32: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A9: Using Components with Known Vulnerabilities

Page 33: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

How do you know whether

they are vulnerable?

Page 34: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

A10: Unvalidated Redirects and Forwards

Page 35: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

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

Page 36: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Very quick conclusion

Page 37: RIA security based on OWASP Top 10€¦ · OWASP Top 10 Open Web Application Security Project. Rich Internet Applications. 1! 0 1! 1 0 1! 1 1 0. ... A5: Security Misconfiguration

Did we get some detail wrong? !

Questions? !? [email protected]

[email protected]