SlideShare a Scribd company logo
When Web 2.0 Attacks!
Understanding Ajax, Flash and other highly interactive web
technologies…

                                              Rafal M. Los
                                              HP ASC Sr. Security Solutions Expert


                                                                                1

   15
Fire! … Aim! Ready?

Question 1: Web 2.0 content is being developed
 primarily by the same developers that write
 traditional web code. True or False?

Question 2: Everyone understands the idea of
 “Web 2.0” and there are concrete standards.
 True or False?

Question 3: Your company has deployed “Web
 2.0 stuff” already. True or False?
                                                 2
Answers…

Question 1: False! Web 2.0 is being developed in
 a large part not by traditional developers, but by
 “marketing or media folks”…

Question 2: False! Ask 2 different people to
 define “Web 2.0”… listen to their answers.

Question 3: (most likely) True! … and if you
 don‟t know it, it‟s even worse.

                                                      3
Browser Evolution

Render simple HTML content                      o
                                                n
Render complex, synchronous content
                                                l
Render complex, asynchronous content            i
                                                n
Perform complex, asynchronous interactions
                                                e
Perform complex, asynchronous, offline interactions
                                                      4
Let‟s start by thinking
 offensively


                          5
Understanding Web 2.0 Motivations


2 reasons “Web 2.0” happened…
  1. Increased demand for processor cycles
  2. Increased demand for bandwidth



What happened…
 Logic moved from server  client
 Invention of asynchronous transaction
 The “offline web” application
                                             6
Examples – What Could Possibly Go Wrong?

…
                what could possibly go wrong?

Manipulation of business logic
 Client-side data validations
Exposure of sensitive information




                                                7
Client-Side Logic Manipulation

try {
               strURI = ExternalInterface.call("getLittleServer");
               …
               n1 = parseInt(strN1);
               n2 = parseInt(strN2);
               nAlgo = n1 * n2 * nScore + nScore;
               strToPass = nGameId + "," + nScore + "," + nTime + "," + nAlgo;
               encrypted_data = MD5.hash(strToPass);
               submission_data = "score=" + nScore + "|gameId=" + nGameId +
    "|timestamp=" + nTime + "|key=" + encrypted_data;
               variables = new URLVariables();
            variables.attr1 = submission_data;
               request = new URLRequest(strURI);
            request.data = variables;
            navigateToURL(request, "_self");
            return submission_data;
         …
                                                                                 8
Examples – What Could Possibly Go Wrong?

…
                what ^ could possibly go wrong?

Manipulation of business logic
 Client-side data validations
Exposure of sensitive information




                                                  9
Client-Side Data Validations
…
button 9 {

    on (release, keyPress '<Enter>') {
     if (password eq „ PASSWORD ') {
       getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/778.html', '');
     } else {
       if (password eq ' PASSWORD ') {
         getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/781.html', '');
       } else {
         if (password eq ' PASSWORD ') {
           getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/783.html', '');
         } else {
           if (password eq „ PASSWORD ') {
             getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/771.html', '');
           } else {
             if (password eq „ PASSWORD ') {
               getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/799.html', '');
             } else {
…




                                                                                                  10
11
Examples – What Could Possibly Go Wrong?

…
                what ^ could possibly go wrong?

Manipulation of business logic
 Client-side data validations
Exposure of sensitive information




                                                  12
Thinking Web 2.0 Offense

private static function query(arg0:String, arg1:flash.events::EventDispatcher = null)
   {
    …
       trace("2:MySQL Query: " + statement);
       if(this.connection == null)
       {
           try {
              this.connection = new Connection(irrcrpt("dqgurjudgh.frp", 3), 3306,
    irrcrpt("icog_nqikp", 2), irrcrpt("d1su4y", 1), irrcrpt("jdph", 3));

         } catch (e:SecurityError) {
            var loc1:* = e;
                  statement = null;
            Alert.show(statement.message, "Security Error");
            …
     }

                                                                                        13
Thinking Web 2.0 Offense




              hacker       14
Let‟s decompile some
 flash!
   … wait, I thought you couldn’t do that!


                                             15
Attacking Web 2.0 Sites

Having some fun with MapQuest… (yes, still)




                                              16
Attacking Web 2.0 Sites

Having some fun with MapQuest… (yes, still)

                               We insert the infamous iFrame

                                  </iframe><script>
                                  alert(document.cookie)
                                  </script>


PLAIN => PostalCode="><frame
Let’s ENCODE it to get past black-listing filters…
%22%3e%3cframe%20src%3dhttps%3a%2f%2fblue-sea-697d.quartiers047.workers.dev%3a443%2fhttp%2fgoogle.com%3e
%3c%2fiframe%3e%3cscript%3ealert(document.cookie)%3c%2f
script%3e                                                      17
Attacking Web 2.0 Sites

… and then this happens!




                           18
What Did We Just Learn?

Web 2.0 isn‟t some magical new “thing”; it‟s a
 conglomeration of old technologies…



…and yes, all the
  old bugs are
  back.




                                                 19
The HTML v5 Specification


 Standards rule.
               Consider this…

 ClickJacking was an abuse of standards
 HTML v5 now has local database specification
 HTML v5 has an offline application specification
 HTML v5 is so big few people have read it all


                                                     20
Specification for Offline Web Apps

From W3.org        http://www.w3.org/TR/offline-webapps/


Users of typical online Web applications are only able to
  use the applications while they have a connection to the
  Internet. When they go offline, they can no longer
  check their e-mail, browse their calendar appointments...

The HTML 5 specification provides two solutions to this:
  a SQL-based database API for storing data locally, and
  an offline application HTTP cache for ensuring
  applications are available even when the user is not
  connected to their network.
                                                              21
Mechanisms for Offline Apps


SQL-based database API for storing data locally
and an
offline application HTTP cache



What could possibly go wrong?



                                                  22
Implementing Offline App Concepts

Remote System (Application)

                              Would you rather hack this…
  Database Application
                                               … or this?
     Hardened Defenses



                                    Browser…
          Internet




                              Local        Local App
                              Database     Cache            23
Simple Problems with Offline Apps



Online Application                      Offline Application
Remote data storage                     Local data storage
    Enterprise DB typically “secured”       Local DB “forgotten”
    Enterprise DB difficult to access       Local DB … on local filesystem
    Attack trips security mechanisms        No local security mechanisms
Remote Logic                            Local “Cached” Logic
    Manipulate at run-time, remotely        Manipulate code, locally
    Remote validation of logic              Fully control/manipulate logic




                                                                             24
Then Came Social Media…




                  First, came the applications…

                  They were attacked…a lot…

                  …then hardened.



                                                  25
Users Demanded More




                      Users wanted more.

                      Applications were
                      extended via APIs.




                                           26
Social Sites Were Extended…




                              3rd parties
                              built
                              interfaces
                              using the
                              APIs



                                            27
Hackers Exploited Extensions/APIs




                                    Hackers
                                    attacked
                                    users via
                                    application
                                    APIs



                                                  28
Web 2.0 Attacked Via Extension

FaceBook still fighting worms and hacks against
  users via extensions (or plug-ins) built using
  legal API extensions (Koobface?)

Twitter API continually being abused by worms
  and “bots” to spam and seed trojan malware

Why attack a hardened resource/site when a
 hacker can use APIs to write malicious plug-ins?

                                                    29
So what do we do
 about it?


                   30
The 3½ Keys to Success


o Perform all control logic server-side
o Validate all data at ingress & egress
o Build zero-trust interfaces



… and remember, “the user will always choose
 dancing bears over security”. -Schenier


                                               31
Perform All Control Logic Server-Side

Application-critical logic must always be performed
  on the server side, where it is less likely to be
  manipulated

• Remember you can never trust code once it
  leaves your control
• Web code can and will be reverse-engineered
  (flash, java, etc)
• Never push critical information (passwords,
  connection strings) to the client
                                                      32
Validate All Data at Ingress/Egress

Validate all data as it comes into your application,
  and also as it leaves

• Validate every single piece of data, always
• Mix white-list and black-list, focusing on
  minimum required data sets
• Make sure you know what‟s leaving your
  application…



                                                       33
Build Zero-Trust Interfaces

Assume the APIs or web-services you expose will
  be attacked

• Never trust the interface to provide clean data,
  legal calls, or valid requests
• Authenticate interfaces when ever possible
• Never trust your own code once it‟s in the user‟s
  browser (least-privilige)
• Adopt the mentality of …”If you were sticking
  your hand into a dark, unknown box”
                                                      34
Save the User, Save the World


Usable security is a myth on the web.

Web 2.0+ focuses on usability, over security.

“Cool” wins over “secure” every time.

Never trust to user to “know better”.


                                                35
Thank You


            Rafal Los
            Twitter: @RafalLos
            Email: Rafal@HP.com
            Direct: +1 (765) 247 - 2325

            Blogs:
            “Following the White Rabbit”
            http://www.communities.hp.com/securitysoftware/blogs/rafal/default.aspx
            “Digital Soapbox”
            http://preachsecurity.blogspot.com



            Oh! … and I work at HP’s Application
            Security Center (ASC)




                                                                                      36

More Related Content

PDF
Web Apps vs Blockchain dApps (Smart Contracts): tools, vulns and standards
SecuRing
 
PDF
Zero-Knowledge Proofs: Privacy-Preserving Digital Identity with Clare Nelson
SSIMeetup
 
PDF
Obfuscation-Resilient Privacy Leak Detection for Mobile Apps
NECST Lab @ Politecnico di Milano
 
PDF
SSL: Past, Present and Future
Luis Grangeia
 
PDF
[CB20] Pwning OT: Going in Through the Eyes by Ta-Lun Yen
CODE BLUE
 
PDF
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
CODE BLUE
 
PDF
Cyber Security Whitepaper 2018 | vTech Solution
Simrat Singh
 
PDF
All you need to know about SSI for Corporates and IoT – Heather Vescent
Blockchain España
 
Web Apps vs Blockchain dApps (Smart Contracts): tools, vulns and standards
SecuRing
 
Zero-Knowledge Proofs: Privacy-Preserving Digital Identity with Clare Nelson
SSIMeetup
 
Obfuscation-Resilient Privacy Leak Detection for Mobile Apps
NECST Lab @ Politecnico di Milano
 
SSL: Past, Present and Future
Luis Grangeia
 
[CB20] Pwning OT: Going in Through the Eyes by Ta-Lun Yen
CODE BLUE
 
[CB20] Operation I am Tom: How APT actors move laterally in corporate network...
CODE BLUE
 
Cyber Security Whitepaper 2018 | vTech Solution
Simrat Singh
 
All you need to know about SSI for Corporates and IoT – Heather Vescent
Blockchain España
 

What's hot (14)

PPTX
Internet transaction and communication security
Dianoesis
 
PDF
Frost & Sullivan: Moving Forward with Distributed Cryptography
EMC
 
PPTX
Improving privacy in blockchain using homomorphic encryption
Razi Rais
 
PPTX
Defcon Crypto Village - OPSEC Concerns in Using Crypto
John Bambenek
 
PDF
Darknet - Is it good for you?
Jonathan Jedrasiak
 
PDF
Security Theatre - AmsterdamPHP
xsist10
 
PDF
Module 21 (cryptography)
Wail Hassan
 
PDF
Hacknbeers sqli and cryptography
Miguel Ibarra
 
PDF
THE BITCOINHEIST: CLASSIFICATIONS OF RANSOMWARE CRIME FAMILIES
ijcsit
 
DOCX
Identity based proxy-oriented data uploading and
Kamal Spring
 
PPTX
Crypto-Jacking, Ransomware & Worming Malware's Frightening Future (Keynote an...
Jay Beale
 
PDF
Secrets of Google VRP by: Krzysztof Kotowicz, Google Security Team
OWASP Delhi
 
PPTX
Top 10 Web Hacks 2012
Matt Johansen
 
PDF
Hyperledger Indy Platform - Privacy, Security and Power for Digital Identity ...
Gokul Alex
 
Internet transaction and communication security
Dianoesis
 
Frost & Sullivan: Moving Forward with Distributed Cryptography
EMC
 
Improving privacy in blockchain using homomorphic encryption
Razi Rais
 
Defcon Crypto Village - OPSEC Concerns in Using Crypto
John Bambenek
 
Darknet - Is it good for you?
Jonathan Jedrasiak
 
Security Theatre - AmsterdamPHP
xsist10
 
Module 21 (cryptography)
Wail Hassan
 
Hacknbeers sqli and cryptography
Miguel Ibarra
 
THE BITCOINHEIST: CLASSIFICATIONS OF RANSOMWARE CRIME FAMILIES
ijcsit
 
Identity based proxy-oriented data uploading and
Kamal Spring
 
Crypto-Jacking, Ransomware & Worming Malware's Frightening Future (Keynote an...
Jay Beale
 
Secrets of Google VRP by: Krzysztof Kotowicz, Google Security Team
OWASP Delhi
 
Top 10 Web Hacks 2012
Matt Johansen
 
Hyperledger Indy Platform - Privacy, Security and Power for Digital Identity ...
Gokul Alex
 
Ad

Similar to SecTor '09 - When Web 2.0 Attacks! (20)

PPTX
Hackers versus Developers and Secure Web Programming
Akash Mahajan
 
PPTX
Web 2.0 security woes
SensePost
 
PDF
Web Application Security with PHP
jikbal
 
PPTX
Social networks security risks
osuhaibany
 
PPTX
Defending Your Frontend
Bishan Singh
 
PDF
Is the Web at Risk?
Carlos Serrao
 
PPTX
State of the information security nation
SensePost
 
PDF
Rich Web App Security - Keeping your application safe
Jeremiah Grossman
 
PDF
BeEF: The Browser Exploitation Framework
awiasecretary
 
PDF
Protecting Your APIs Against Attack & Hijack
CA API Management
 
PDF
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
PDF
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
PPT
DC612 Day - Web Application Security: OWASP Top 10
dc612
 
PDF
Crash Course In Brain Surgery
morisson
 
PPTX
Html5 security
Krishna T
 
PDF
Xfocus xcon 2008_aks_oknock
ownerkhan
 
PDF
Top Ten Web Attacks
Ajay Ohri
 
PDF
Amish Umesh - Future Of Web App Testing - ClubHack2007
ClubHack
 
PPT
Bank One App Sec Training
Mike Spaulding
 
PDF
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 
Hackers versus Developers and Secure Web Programming
Akash Mahajan
 
Web 2.0 security woes
SensePost
 
Web Application Security with PHP
jikbal
 
Social networks security risks
osuhaibany
 
Defending Your Frontend
Bishan Singh
 
Is the Web at Risk?
Carlos Serrao
 
State of the information security nation
SensePost
 
Rich Web App Security - Keeping your application safe
Jeremiah Grossman
 
BeEF: The Browser Exploitation Framework
awiasecretary
 
Protecting Your APIs Against Attack & Hijack
CA API Management
 
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
Defcon 20-zulla-improving-web-vulnerability-scanning
zulla
 
DC612 Day - Web Application Security: OWASP Top 10
dc612
 
Crash Course In Brain Surgery
morisson
 
Html5 security
Krishna T
 
Xfocus xcon 2008_aks_oknock
ownerkhan
 
Top Ten Web Attacks
Ajay Ohri
 
Amish Umesh - Future Of Web App Testing - ClubHack2007
ClubHack
 
Bank One App Sec Training
Mike Spaulding
 
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 
Ad

More from Rafal Los (20)

PDF
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
 
PDF
The 5 Ps of Preparedness - Hope is Not a Strategy [1].pdf
Rafal Los
 
PDF
Irrational But Effective - Applying Parenthood Lessons to Cyber Security
Rafal Los
 
PPTX
SAINTCON 21 - Of Sandcastles and Luck (Fixing Vulnerability Management)
Rafal Los
 
PPTX
Strategies and Tactics for Effectively Managing Vulnerabilities in Diverse En...
Rafal Los
 
PDF
Lies, Fables and Security Metrics
Rafal Los
 
PDF
Losing battles, winning wars
Rafal Los
 
PPTX
5 Things CFOs Need to Know About Enterprise Security - HP CFO Summit 2013
Rafal Los
 
PPTX
Operationalizing Security Intelligence [ InfoSec World 2014 ]
Rafal Los
 
PDF
Operationalizing security intelligence for the mid market - Rafal Los - RSA C...
Rafal Los
 
PPTX
Rebooting the Enterprise Security Program for Defensibility - ISSA Internatio...
Rafal Los
 
PPTX
Cloud Security Alliance- Challanges of an elastic environment v8a [public]
Rafal Los
 
PPTX
Threat modeling the security of the enterprise
Rafal Los
 
PPTX
Making Measurable Gains - Contextualizing 'Secure' in Business
Rafal Los
 
PDF
Security BSides Atlanta - "The Business Doesn't Care..."
Rafal Los
 
PPTX
Software Security Assurance - Program Building (You're going to need a bigger...
Rafal Los
 
PDF
The Future of Software Security Assurance
Rafal Los
 
PDF
Defying Logic - Business Logic Testing with Automation
Rafal Los
 
PDF
Ultimate Hack! Layers 8 & 9 of the OSI Model
Rafal Los
 
PDF
Into the Rabbithole - Evolved Web App Security Testing (OWASP AppSec DC)
Rafal Los
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
 
The 5 Ps of Preparedness - Hope is Not a Strategy [1].pdf
Rafal Los
 
Irrational But Effective - Applying Parenthood Lessons to Cyber Security
Rafal Los
 
SAINTCON 21 - Of Sandcastles and Luck (Fixing Vulnerability Management)
Rafal Los
 
Strategies and Tactics for Effectively Managing Vulnerabilities in Diverse En...
Rafal Los
 
Lies, Fables and Security Metrics
Rafal Los
 
Losing battles, winning wars
Rafal Los
 
5 Things CFOs Need to Know About Enterprise Security - HP CFO Summit 2013
Rafal Los
 
Operationalizing Security Intelligence [ InfoSec World 2014 ]
Rafal Los
 
Operationalizing security intelligence for the mid market - Rafal Los - RSA C...
Rafal Los
 
Rebooting the Enterprise Security Program for Defensibility - ISSA Internatio...
Rafal Los
 
Cloud Security Alliance- Challanges of an elastic environment v8a [public]
Rafal Los
 
Threat modeling the security of the enterprise
Rafal Los
 
Making Measurable Gains - Contextualizing 'Secure' in Business
Rafal Los
 
Security BSides Atlanta - "The Business Doesn't Care..."
Rafal Los
 
Software Security Assurance - Program Building (You're going to need a bigger...
Rafal Los
 
The Future of Software Security Assurance
Rafal Los
 
Defying Logic - Business Logic Testing with Automation
Rafal Los
 
Ultimate Hack! Layers 8 & 9 of the OSI Model
Rafal Los
 
Into the Rabbithole - Evolved Web App Security Testing (OWASP AppSec DC)
Rafal Los
 

Recently uploaded (20)

PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Doc9.....................................
SofiaCollazos
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 

SecTor '09 - When Web 2.0 Attacks!

  • 1. When Web 2.0 Attacks! Understanding Ajax, Flash and other highly interactive web technologies… Rafal M. Los HP ASC Sr. Security Solutions Expert 1 15
  • 2. Fire! … Aim! Ready? Question 1: Web 2.0 content is being developed primarily by the same developers that write traditional web code. True or False? Question 2: Everyone understands the idea of “Web 2.0” and there are concrete standards. True or False? Question 3: Your company has deployed “Web 2.0 stuff” already. True or False? 2
  • 3. Answers… Question 1: False! Web 2.0 is being developed in a large part not by traditional developers, but by “marketing or media folks”… Question 2: False! Ask 2 different people to define “Web 2.0”… listen to their answers. Question 3: (most likely) True! … and if you don‟t know it, it‟s even worse. 3
  • 4. Browser Evolution Render simple HTML content o n Render complex, synchronous content l Render complex, asynchronous content i n Perform complex, asynchronous interactions e Perform complex, asynchronous, offline interactions 4
  • 5. Let‟s start by thinking offensively 5
  • 6. Understanding Web 2.0 Motivations 2 reasons “Web 2.0” happened… 1. Increased demand for processor cycles 2. Increased demand for bandwidth What happened…  Logic moved from server  client  Invention of asynchronous transaction  The “offline web” application 6
  • 7. Examples – What Could Possibly Go Wrong? … what could possibly go wrong? Manipulation of business logic  Client-side data validations Exposure of sensitive information 7
  • 8. Client-Side Logic Manipulation try { strURI = ExternalInterface.call("getLittleServer"); … n1 = parseInt(strN1); n2 = parseInt(strN2); nAlgo = n1 * n2 * nScore + nScore; strToPass = nGameId + "," + nScore + "," + nTime + "," + nAlgo; encrypted_data = MD5.hash(strToPass); submission_data = "score=" + nScore + "|gameId=" + nGameId + "|timestamp=" + nTime + "|key=" + encrypted_data; variables = new URLVariables(); variables.attr1 = submission_data; request = new URLRequest(strURI); request.data = variables; navigateToURL(request, "_self"); return submission_data; … 8
  • 9. Examples – What Could Possibly Go Wrong? … what ^ could possibly go wrong? Manipulation of business logic  Client-side data validations Exposure of sensitive information 9
  • 10. Client-Side Data Validations … button 9 { on (release, keyPress '<Enter>') { if (password eq „ PASSWORD ') { getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/778.html', ''); } else { if (password eq ' PASSWORD ') { getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/781.html', ''); } else { if (password eq ' PASSWORD ') { getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/783.html', ''); } else { if (password eq „ PASSWORD ') { getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/771.html', ''); } else { if (password eq „ PASSWORD ') { getURL('http://www.SomeCompany.tld/client_pages/CUSTOMER_REMOVED/799.html', ''); } else { … 10
  • 11. 11
  • 12. Examples – What Could Possibly Go Wrong? … what ^ could possibly go wrong? Manipulation of business logic  Client-side data validations Exposure of sensitive information 12
  • 13. Thinking Web 2.0 Offense private static function query(arg0:String, arg1:flash.events::EventDispatcher = null) { … trace("2:MySQL Query: " + statement); if(this.connection == null) { try { this.connection = new Connection(irrcrpt("dqgurjudgh.frp", 3), 3306, irrcrpt("icog_nqikp", 2), irrcrpt("d1su4y", 1), irrcrpt("jdph", 3)); } catch (e:SecurityError) { var loc1:* = e; statement = null; Alert.show(statement.message, "Security Error"); … } 13
  • 14. Thinking Web 2.0 Offense hacker 14
  • 15. Let‟s decompile some flash! … wait, I thought you couldn’t do that! 15
  • 16. Attacking Web 2.0 Sites Having some fun with MapQuest… (yes, still) 16
  • 17. Attacking Web 2.0 Sites Having some fun with MapQuest… (yes, still) We insert the infamous iFrame </iframe><script> alert(document.cookie) </script> PLAIN => PostalCode="><frame Let’s ENCODE it to get past black-listing filters… %22%3e%3cframe%20src%3dhttps%3a%2f%2fblue-sea-697d.quartiers047.workers.dev%3a443%2fhttp%2fgoogle.com%3e %3c%2fiframe%3e%3cscript%3ealert(document.cookie)%3c%2f script%3e 17
  • 18. Attacking Web 2.0 Sites … and then this happens! 18
  • 19. What Did We Just Learn? Web 2.0 isn‟t some magical new “thing”; it‟s a conglomeration of old technologies… …and yes, all the old bugs are back. 19
  • 20. The HTML v5 Specification Standards rule. Consider this…  ClickJacking was an abuse of standards  HTML v5 now has local database specification  HTML v5 has an offline application specification  HTML v5 is so big few people have read it all 20
  • 21. Specification for Offline Web Apps From W3.org  http://www.w3.org/TR/offline-webapps/ Users of typical online Web applications are only able to use the applications while they have a connection to the Internet. When they go offline, they can no longer check their e-mail, browse their calendar appointments... The HTML 5 specification provides two solutions to this: a SQL-based database API for storing data locally, and an offline application HTTP cache for ensuring applications are available even when the user is not connected to their network. 21
  • 22. Mechanisms for Offline Apps SQL-based database API for storing data locally and an offline application HTTP cache What could possibly go wrong? 22
  • 23. Implementing Offline App Concepts Remote System (Application) Would you rather hack this… Database Application … or this? Hardened Defenses Browser… Internet Local Local App Database Cache 23
  • 24. Simple Problems with Offline Apps Online Application Offline Application Remote data storage Local data storage Enterprise DB typically “secured” Local DB “forgotten” Enterprise DB difficult to access Local DB … on local filesystem Attack trips security mechanisms No local security mechanisms Remote Logic Local “Cached” Logic Manipulate at run-time, remotely Manipulate code, locally Remote validation of logic Fully control/manipulate logic 24
  • 25. Then Came Social Media… First, came the applications… They were attacked…a lot… …then hardened. 25
  • 26. Users Demanded More Users wanted more. Applications were extended via APIs. 26
  • 27. Social Sites Were Extended… 3rd parties built interfaces using the APIs 27
  • 28. Hackers Exploited Extensions/APIs Hackers attacked users via application APIs 28
  • 29. Web 2.0 Attacked Via Extension FaceBook still fighting worms and hacks against users via extensions (or plug-ins) built using legal API extensions (Koobface?) Twitter API continually being abused by worms and “bots” to spam and seed trojan malware Why attack a hardened resource/site when a hacker can use APIs to write malicious plug-ins? 29
  • 30. So what do we do about it? 30
  • 31. The 3½ Keys to Success o Perform all control logic server-side o Validate all data at ingress & egress o Build zero-trust interfaces … and remember, “the user will always choose dancing bears over security”. -Schenier 31
  • 32. Perform All Control Logic Server-Side Application-critical logic must always be performed on the server side, where it is less likely to be manipulated • Remember you can never trust code once it leaves your control • Web code can and will be reverse-engineered (flash, java, etc) • Never push critical information (passwords, connection strings) to the client 32
  • 33. Validate All Data at Ingress/Egress Validate all data as it comes into your application, and also as it leaves • Validate every single piece of data, always • Mix white-list and black-list, focusing on minimum required data sets • Make sure you know what‟s leaving your application… 33
  • 34. Build Zero-Trust Interfaces Assume the APIs or web-services you expose will be attacked • Never trust the interface to provide clean data, legal calls, or valid requests • Authenticate interfaces when ever possible • Never trust your own code once it‟s in the user‟s browser (least-privilige) • Adopt the mentality of …”If you were sticking your hand into a dark, unknown box” 34
  • 35. Save the User, Save the World Usable security is a myth on the web. Web 2.0+ focuses on usability, over security. “Cool” wins over “secure” every time. Never trust to user to “know better”. 35
  • 36. Thank You Rafal Los Twitter: @RafalLos Email: [email protected] Direct: +1 (765) 247 - 2325 Blogs: “Following the White Rabbit” http://www.communities.hp.com/securitysoftware/blogs/rafal/default.aspx “Digital Soapbox” http://preachsecurity.blogspot.com Oh! … and I work at HP’s Application Security Center (ASC) 36