Web 2.0 Security Considerations: Dr. Andreas Wespi Mgr. Security & Assurance
Web 2.0 Security Considerations: Dr. Andreas Wespi Mgr. Security & Assurance
Zurich
Watson • Cryptography • JavaCard
• Biometrics • OS/Linux Security • Business • Privacy Mgmt
• Cryptography • Privacy Processes • Services/ODIS
• Ethical Hacking • Secure HW • Dependability • Storage Security
• Intrusion Defense • Web Services • Identity Mgmt • Web Services
• Language Sec • Wireless
Web 2.0 Security • Intrusion Defense • Risk Management
Beijing
Almaden
• Rights Mgmt Haifa Tokyo
• Privacy • Web Services
Dehli • Web
Crypto
2.0Hardware
• Services/ODIS
Austin
Motivation
300
35000 Average # of days between
280
Number of vulnerabilities 30480
publication and broad
30000 reported to CERT/CC 250 exploitation of a vulnerability.
since 1995.
25000
200 205
22416
20000
16426 150
15000 12946
100 104
10000
9162 88
5033 50
5000
2596 26
1089 1506
516 827
171 10
0 0
1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006
1999 2000 2001 2002 2003 2004
Source: CERT/CC Statistics; CERT, Source: Information Security Magazine (based on Foundstone),
http://www.cert.org/stats/ June 2004; http://infosecuritymag.techtarget.com/
Application-level
vulnerabilities [%]
Application Security 80
70
60
50
Shift towards application-level vulnerabilities:
40
0
• Use of weakly typed scripting languages 2002 2003 2004 2005
http://www.denimgroup.com/media/pdfs/DenimGroup_Web20Security_AJAXWorld_20070321.pdf
AJAX
JavaScript call
Browser
HTML+CSS data
http://www.adaptivepath.com/publications/essays/archives/000385.php
Some Atttacks
Samy Worm
Written in JavaSript. The code was first placed in Samy’s profile. Once anyone viewed
Samy’s profile, he would unknowingly execute the code.
Upon executing the code, it would add Samy as a friend. This normally requires
approval, but this was all done in the background via Ajax.
Bypassed numerous negative filters against possibly malicious tags, attributes, etc.
Relied on the same functionality being served from multiple hostnames, supporting the
Same-Origin Policy
–profile.myspace.com and www.myspace.com
Used a multi-step background combination of GETs and POSTs
–Get the list of friends
–Parse out special post tokens
–Add Samy as new friend
The most important step is that the code reproduces itself by adding itself to the profile
of the user viewing an infected profile.
More than 1 Mio. Infected profiles within the first 20 hours.
http://blog.outer-court.com/archive/2005-10-14-n81.html
Injection Vulnerabilities
Injection Vulnerabilities
Injections are the major class of application-level
vulnerabilities
CSSE: example
CSSE: example
CSSE: example
Validating effectiveness
Tested on phpBB, a popular bulletin-board application:
• v2.0.x had 12 SQL injection vulnerabilities in BugTraq [8] ...
• ... of which we managed to reproduce seven (Bugtraq 6634,
9122, 9314, 9942, 9896, 9883, 10722 )
Results
Results:
– Self-tests passed (as with unpatched)
– Correct operation of phpBB
– All SQL injections detected successfully
Overhead:
– Performance overhead (CGI): ~2-10%
• the number of affected strings is relatively small
• efficient lookup
– Memory overhead: ~2%
N. Daswani et al., “Foundations of Security: What Every Programmer Needs to Know”, ISBN 978-1590597842
AJAX calls are very silent and end-users would not be able to determine
whether or not the browser is making silent calls using the
XMLHTTPRequest object.
When the browser makes an AJAX call to any Web site it replays cookies
for each request. This can lead to potential opportunities for compromise.
For example, John has logged in to his bank and authenticated on the
server. After completing the authentication process he gets a session
cookie. His bank’s page has a lot of critical information.
Now he browses other pages while still logged in to his bank’s account
Web page and lands at an attacker’s Web page.
On this page the attacker has written silent AJAX code which makes
backend calls to his bank without John’s consent, fetches critical
information from the pages and sends this information to the attacker’s
Web site.
This leads to a security breach and leakage of confidential information.
www.hackerhome.org
– <form method=“POST” name=“evilform”
target=“hiddenframe”
action=https://www.myfavoritesite.com/update_profile
<input type=“hidden” name=“password” value=“evilpassword”>
</form>
<iframe name=“hiddenframe”
style=“display: none”>
</iframe>
<script>
document.evilform.submit();
</script>
http://www.net-security.org/article.php?id=949
XML Poisoning
XML traffic goes back and forth between server and browser in
many of the Web 2.0 applications.
Web applications consume XML blocks coming from AJAX clients.
It is possible to poison these XML blockx
Not uncommon is the technique to apply recursive payloads to
similar-producing XML nodes multiple times. If the engine’s
handling is poor this may result in a denial of services on the
server.
Many attackers also produce malformed XML documents that can
disrupt logic depending on parsing mechanisms in use on the
server.
XML external entity reference is an XML property which can be
manipulated by an attacker. This can lead to arbitrary file or TCP
connection openings that can be leveraged by an attacker.
Conclusions
Security has been overlooked in the rush to adopt Web 2.0 features.
AJAX itself does not introduce vulnerabilities, it just makes it easier to
make old mistakes.
The software industry is exiting the desktop applications era, where buffer
overflows were the big security problem. Now it's JavaScript in AJAX that is
raising concerns.
The Web 2.0 model of integrating partner- and customer-generated
components into your Web site means that administrators now have to
worry not only about the security of their own Web sites, but the security of
those interconnected pieces.
We have to implement security best practices.
Tooling is needed that supports the developer.
Security has to be considered already in the design phase.
Functionality vs. security.
IBM Research
– IBM Zurich Research Lab:
• http://www.zurich.ibm.com
– Security research at IBM:
• http://www.research.ibm.com/compsci/security