SlideShare a Scribd company logo
Odyssey to Web Browser Security - 1




                  Prepared by: Prosunjit Biswas,
                  Advisor : Dr. Ravi Sandhu
                  Presented : ICS @ UTSA (12th April, 2012)
                  Email: prosun.csedu@gmail.com
What is Web Browsers
               for?


• Web Browsers Retrieve, Present and
 Traverse information on Web typically
 provided by web servers.

• Web Browsers use URI/URLs to locate and
 retrieve information.
Http Request (URL) format
"protocol:" "//" host [ ":" port ] [ abs_path [
"?" query ]]

Examples:
1. http://cs.utsa.edu/index.html
2. http://utsa.summon.serialssolutions.com/search/results?
spellcheck=true&q=security
3. http://www.php.net/manual/en/reserved.variables.get.php
4. http://www.amazon.com/s/ref=nb_sb_noss/185-1213459-
6355102 ?url=search-alias%3Daps&field-keywords=iphone
Notice…


• The ‘query’ part in the URL may contain
    user provided data that is feed to the
    application.

•   And contains Payload for maximum
    possible attacks.
Web Application Architecture:
 Server Side & Client Side




        Courtesy: “Top 10 attacks” by Saumil Shah
How a Request is resolved by the
   Server for the Browser?
Server Response at Browser Side
Server Response Includes:
  o Data/Information (personal Info)

  o HTML Markups(table, paragraph)

  o Javascript / Other Script

  o Cookies ( session information)

  o Browser Configuration Meta data

  o Other Resources(Ex: Flash, CSS )
HTML Markup

• HTML Markups provides presentation for the
 data/content.

• In Web 2.0 data & Markup altogether build
 Document Object Model (DOM)

• DOM form a XML tree structure for easy
 retrieval of data.
Script / Javascript
• When We say Dynamic HTML( DHTML), this
  dynamicity is achieved by JavaScript at the
  Browser Side.

• JavaScript can manipulate (Insert/delete/
  Modify) any content in the browser .

• Unfortunately it is „The World's Most
  Misunderstood Programming Language’
                     -- Douglas Crockford
Where to put JavaScript in a web
               page ?
• Typically JS can be put almost all places.
• <script> JS content </script>
• <input onclick=“JS content”>
• <img src=“javascript:JS Content”>
• And others.
How Web Browsing can be
              insecure?
• Attacker Steals data [Attack User information]
• Attacker defaces a webpage [Attack markup]
• Inject / Modify JavaScript [Script Based
    attack]
•   Steal Cookie
•   Insert Meta Data on page
•   Attack other Resources [ex: Image]
Notice …



• All the mentioned attacks can be  achieved
 by injecting / modifying JavaScript on a
 honest web page.
Risk That We Do Not Care …
• A website is malicious and an user visits this
  site and get infected.
       [We can leave it to the discretion of   the
  visitor]
Risk That We Care(2) …
• A website is not intended to be malicious but
  attacker has compromised this page and let
  everyone who visit it, be compromised.
  o [ We do Care for this ]
Attacking Approach (Client-server
            Perspective)
• Attack Servers / Services [ Server side
 attack]
  o Ex. Website Defacement ,
  o SQL injection,
  o DoS Attack and others
• Attack Web Client [ Client / Browser based
 attack].
  o Ex: XSS ( Cross Site Scripting)
  o XSRF ( Cross Site Request forgery)
  o Phishing ( Social Eng.) and others
Attacking Approach (Way of
               Attacks)
• Content Injection
  o SQL Injection
  o Script Injection (XSS)
  o DOM element Injection (DOM based XSS)
• Breaking Access-Control / Access-
 Restriction
  o Cross Domain / Cross Frame Attack
  o Ex. Cross Domain Capability Leaks
• Exploiting Application Configuration
  o Session Hijacking / Credential Stealing
  o Failure to Restrict URL access
  o Insecure Cryptography
Attacking Approach (Way of
         Attacks) continuing…
• Insecure Network
  o Proxy-based attack
  o Man-in-the-middle attacks


• Web Based Malware Attack

  We are more Interested on Content Injection Attack
   because of its wide attack surface.
Content Injection (Through URL)
Demonstrating Reflected XSS attack
            Sends through email / other way

                    www.goodhost.com?search=@#badcontent#@
                    @#badcontent #@



                                                                   Clicks the URL

            Client Web Browser


                                                       @#badcontent #@
           @#badcontent#@
                                                             @#badcontent #@



                                                              Web Server
 User is infected with the injection attack
Content Injection (via comment)
Demonstrating ‘Stored XSS attack’
                                            Inserted in DB

                       @#comment!@#

                       Malicious content Comment Retrieved
                                         From database




 @#comment!@#
                                                               Clicks the URL
                                                                Clicks the URL

                                                                Request

       Put Malicious comment




                                                         Bob Request the same page
Content Injection Attack (2) (What
               content?)


• SQL ( Data Integrity & Privacy attack)
• Script / JavaScript (Privacy attack – Steal
    Cookie)
•   DOM Element ( Data Integrity - Phishing )

    We are more Interested in Script Injection
    attack (also called XSS) which is easy and
    obvious but impact is severe therefore
    critical to handle.
Why attackers prefer JavaScript
            injection?


• JavaScript can access almost all resources in
  a web page.

• JavaScript is supported by all major browsers
• JavaScript has great expressive power.
Consequence of XSS attack


• Sensitive Information theft.
  o Credential Theft ( Ex: cookies)


• Intranet Scanning
  o Scan Open ports .


• Attacking other users
  o Replay attack from compromised browser.
What are the Existing Approaches
     to Protect XSS attacks?
All the existing approaches place some kinds of
  restrictions over JavaScript uses.

• Host based Restriction
  o allow JavaScript from a White listed hosts.
  o Restrict JavaScript from Black listed hosts.


• Place holder Restriction
  o Restrict places where JavaScript can be inserted.
What are the Existing Approaches
to Protect XSS attacks …
• Transfer Restriction
  o Restrict Sensitive Resources to be send out to
    other hosts/domains.


• Content Rewrite
  o Re-write JavaScript to delete unsafe code.


• Flow Control
  o Control the flow of sensitive information in
    JavaScript (Taint Sensitive information)
What are other Control Points ?
                                                                     Control JS & DOM
                                                                     Interactions
                                          Output Interface
           Input Interface


                                                                JS                  DOM
                         Control Flow of
                         User provided
Sanitize URL to          data                                                       Cookie
discard
malicious                    Web Server
content
                                            Control JS Communication with
                                            External Domain

                                                                     Control Cookie Send out to
                                                                     External Domain

           Compare input / output interface data for to
           check user whether malicious content is               Other Domains
           trespassed through the server .
References:
•   http://stackoverflow.com/questions/1267284/common-website-attack-
    methods-detection-and-recovery
•   http://yehg.net/lab/pr0js/papers/What%20XSS%20Can%20Do.pdf
o Thanks.

More Related Content

PPTX
Building Secure User Interfaces With JWTs (JSON Web Tokens)
PDF
Html5 localstorage attack vectors
PDF
Session1-Introduce Http-HTTP Security headers
PPTX
Web application security
PPT
XSS and CSRF with HTML5
PPT
Web Security Overview and Demo
PPT
Web Attacks - Top threats - 2010
PDF
Blackhat11 shreeraj reverse_engineering_browser
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Html5 localstorage attack vectors
Session1-Introduce Http-HTTP Security headers
Web application security
XSS and CSRF with HTML5
Web Security Overview and Demo
Web Attacks - Top threats - 2010
Blackhat11 shreeraj reverse_engineering_browser

What's hot (20)

PDF
Modern API Security with JSON Web Tokens
PPTX
Xss (cross site scripting)
PPTX
Micro Web Service - Slim and JWT
PDF
JSON Web Tokens
PPTX
Owasp Top 10 A3: Cross Site Scripting (XSS)
PPT
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
PPTX
Securing Single Page Applications with Token Based Authentication
PDF
HTML5 Top 10 Threats - Silent Attacks and Stealth Exploits
PDF
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PPTX
Identifying XSS Vulnerabilities
PDF
When Ajax Attacks! Web application security fundamentals
PPTX
JWT Authentication with AngularJS
ODP
Authentication Concepts
PDF
Json web token api authorization
PDF
What are JSON Web Tokens and Why Should I Care?
PDF
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
PDF
Authentication: Cookies vs JWTs and why you’re doing it wrong
PDF
Json web token
PDF
Hacking Ajax & Web Services - Next Generation Web Attacks on the Rise
Modern API Security with JSON Web Tokens
Xss (cross site scripting)
Micro Web Service - Slim and JWT
JSON Web Tokens
Owasp Top 10 A3: Cross Site Scripting (XSS)
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
Securing Single Page Applications with Token Based Authentication
HTML5 Top 10 Threats - Silent Attacks and Stealth Exploits
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
Identifying XSS Vulnerabilities
When Ajax Attacks! Web application security fundamentals
JWT Authentication with AngularJS
Authentication Concepts
Json web token api authorization
What are JSON Web Tokens and Why Should I Care?
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Authentication: Cookies vs JWTs and why you’re doing it wrong
Json web token
Hacking Ajax & Web Services - Next Generation Web Attacks on the Rise
Ad

Similar to Secure webbrowsing 1 (20)

PDF
Web Security - Introduction v.1.3
PDF
Web Security - Introduction
PDF
Web Security 101
PDF
Rich Web App Security - Keeping your application safe
PPTX
Cross Site Scripting
PDF
Introduction to Cross Site Scripting ( XSS )
PDF
XSS Exploitation
PDF
Top 10 Web Application vulnerabilities
PPTX
Web Hacking Series Part 4
PDF
xss-100908063522-phpapp02.pdf
KEY
Cross Site Scripting - Mozilla Security Learning Center
PPTX
Burp Suite is a powerful and widely-used tool
PDF
Blind XSS & Click Jacking
PPTX
Hack using firefox
PDF
Is XSS Solvable?
PPTX
Cross Site Scripting Defense Presentation
PPTX
webapplicationattacks-101005070110-phpapp02.pptx
PPTX
Hackers versus Developers and Secure Web Programming
PPTX
Website hacking and prevention (All Tools,Topics & Technique )
Web Security - Introduction v.1.3
Web Security - Introduction
Web Security 101
Rich Web App Security - Keeping your application safe
Cross Site Scripting
Introduction to Cross Site Scripting ( XSS )
XSS Exploitation
Top 10 Web Application vulnerabilities
Web Hacking Series Part 4
xss-100908063522-phpapp02.pdf
Cross Site Scripting - Mozilla Security Learning Center
Burp Suite is a powerful and widely-used tool
Blind XSS & Click Jacking
Hack using firefox
Is XSS Solvable?
Cross Site Scripting Defense Presentation
webapplicationattacks-101005070110-phpapp02.pptx
Hackers versus Developers and Secure Web Programming
Website hacking and prevention (All Tools,Topics & Technique )
Ad

More from UT, San Antonio (20)

PPTX
digital certificate - types and formats
PPTX
Saml metadata
PPTX
Static Analysis with Sonarlint
PPTX
Shellshock- from bug towards vulnerability
PPT
Abac17 prosun-slides
PPT
Abac17 prosun-slides
TXT
Recitation
TXT
Recitation
PDF
Big Data Processing: Performance Gain Through In-Memory Computation
PDF
Enumerated authorization policy ABAC (EP-ABAC) model
PDF
Where is my Privacy presentation slideshow (one page only)
PDF
Three month course
PDF
One month-syllabus
PPT
Zerovm backgroud
PPTX
Security_of_openstack_keystone
PDF
Research seminar group_1_prosunjit
DOCX
Attribute Based Encryption
PPT
Final Project Transciption Factor DNA binding Prediction
PDF
Cyber Security Exam 2
digital certificate - types and formats
Saml metadata
Static Analysis with Sonarlint
Shellshock- from bug towards vulnerability
Abac17 prosun-slides
Abac17 prosun-slides
Recitation
Recitation
Big Data Processing: Performance Gain Through In-Memory Computation
Enumerated authorization policy ABAC (EP-ABAC) model
Where is my Privacy presentation slideshow (one page only)
Three month course
One month-syllabus
Zerovm backgroud
Security_of_openstack_keystone
Research seminar group_1_prosunjit
Attribute Based Encryption
Final Project Transciption Factor DNA binding Prediction
Cyber Security Exam 2

Recently uploaded (20)

PPTX
Condensed_Food_Science_Lecture1_Precised.pptx
PPTX
1751884730-Visual Basic -Unitj CS B.pptx
PPTX
chapter 3_bem.pptxKLJLKJLKJLKJKJKLJKJKJKHJH
PPTX
CORE 1 HOUSEKEEPING TOURISM SECTOR POWERPOINT
PPT
BCH3201 (Enzymes and biocatalysis)-JEB (1).ppt
PPTX
OnePlus 13R – ⚡ All-Rounder King Performance: Snapdragon 8 Gen 3 – same as iQ...
PDF
Prostaglandin E2.pdf orthoodontics op kharbanda
PPTX
cse couse aefrfrqewrbqwrgbqgvq2w3vqbvq23rbgw3rnw345
PDF
HR Jobs in Jaipur: 2025 Trends, Banking Careers & Smart Hiring Tools
PPTX
Surgical thesis protocol formation ppt.pptx
PPTX
normal_menstrual_cycle_,,physiology.PPTX
PPTX
OCCULAR MANIFESTATIONS IN LEPROSY.pptx bbb
PPTX
Definition and Relation of Food Science( Lecture1).pptx
PDF
Sales and Distribution Managemnjnfijient.pdf
PPTX
Cerebral_Palsy_Detailed_Presentation.pptx
PPTX
internship presentation of bsnl in colllege
PPTX
PMP (Project Management Professional) course prepares individuals
PPTX
Principles of Inheritance and variation class 12.pptx
PDF
313302 DBMS UNIT 1 PPT for diploma Computer Eng Unit 2
PPTX
退学买新西兰毕业证(WelTec毕业证书)惠灵顿理工学院毕业证国外证书制作
Condensed_Food_Science_Lecture1_Precised.pptx
1751884730-Visual Basic -Unitj CS B.pptx
chapter 3_bem.pptxKLJLKJLKJLKJKJKLJKJKJKHJH
CORE 1 HOUSEKEEPING TOURISM SECTOR POWERPOINT
BCH3201 (Enzymes and biocatalysis)-JEB (1).ppt
OnePlus 13R – ⚡ All-Rounder King Performance: Snapdragon 8 Gen 3 – same as iQ...
Prostaglandin E2.pdf orthoodontics op kharbanda
cse couse aefrfrqewrbqwrgbqgvq2w3vqbvq23rbgw3rnw345
HR Jobs in Jaipur: 2025 Trends, Banking Careers & Smart Hiring Tools
Surgical thesis protocol formation ppt.pptx
normal_menstrual_cycle_,,physiology.PPTX
OCCULAR MANIFESTATIONS IN LEPROSY.pptx bbb
Definition and Relation of Food Science( Lecture1).pptx
Sales and Distribution Managemnjnfijient.pdf
Cerebral_Palsy_Detailed_Presentation.pptx
internship presentation of bsnl in colllege
PMP (Project Management Professional) course prepares individuals
Principles of Inheritance and variation class 12.pptx
313302 DBMS UNIT 1 PPT for diploma Computer Eng Unit 2
退学买新西兰毕业证(WelTec毕业证书)惠灵顿理工学院毕业证国外证书制作

Secure webbrowsing 1

  • 1. Odyssey to Web Browser Security - 1 Prepared by: Prosunjit Biswas, Advisor : Dr. Ravi Sandhu Presented : ICS @ UTSA (12th April, 2012) Email: prosun.csedu@gmail.com
  • 2. What is Web Browsers for? • Web Browsers Retrieve, Present and Traverse information on Web typically provided by web servers. • Web Browsers use URI/URLs to locate and retrieve information.
  • 3. Http Request (URL) format "protocol:" "//" host [ ":" port ] [ abs_path [ "?" query ]] Examples: 1. http://cs.utsa.edu/index.html 2. http://utsa.summon.serialssolutions.com/search/results? spellcheck=true&q=security 3. http://www.php.net/manual/en/reserved.variables.get.php 4. http://www.amazon.com/s/ref=nb_sb_noss/185-1213459- 6355102 ?url=search-alias%3Daps&field-keywords=iphone
  • 4. Notice… • The ‘query’ part in the URL may contain user provided data that is feed to the application. • And contains Payload for maximum possible attacks.
  • 5. Web Application Architecture: Server Side & Client Side Courtesy: “Top 10 attacks” by Saumil Shah
  • 6. How a Request is resolved by the Server for the Browser?
  • 7. Server Response at Browser Side Server Response Includes: o Data/Information (personal Info) o HTML Markups(table, paragraph) o Javascript / Other Script o Cookies ( session information) o Browser Configuration Meta data o Other Resources(Ex: Flash, CSS )
  • 8. HTML Markup • HTML Markups provides presentation for the data/content. • In Web 2.0 data & Markup altogether build Document Object Model (DOM) • DOM form a XML tree structure for easy retrieval of data.
  • 9. Script / Javascript • When We say Dynamic HTML( DHTML), this dynamicity is achieved by JavaScript at the Browser Side. • JavaScript can manipulate (Insert/delete/ Modify) any content in the browser . • Unfortunately it is „The World's Most Misunderstood Programming Language’ -- Douglas Crockford
  • 10. Where to put JavaScript in a web page ? • Typically JS can be put almost all places. • <script> JS content </script> • <input onclick=“JS content”> • <img src=“javascript:JS Content”> • And others.
  • 11. How Web Browsing can be insecure? • Attacker Steals data [Attack User information] • Attacker defaces a webpage [Attack markup] • Inject / Modify JavaScript [Script Based attack] • Steal Cookie • Insert Meta Data on page • Attack other Resources [ex: Image]
  • 12. Notice … • All the mentioned attacks can be achieved by injecting / modifying JavaScript on a honest web page.
  • 13. Risk That We Do Not Care … • A website is malicious and an user visits this site and get infected. [We can leave it to the discretion of the visitor]
  • 14. Risk That We Care(2) … • A website is not intended to be malicious but attacker has compromised this page and let everyone who visit it, be compromised. o [ We do Care for this ]
  • 15. Attacking Approach (Client-server Perspective) • Attack Servers / Services [ Server side attack] o Ex. Website Defacement , o SQL injection, o DoS Attack and others • Attack Web Client [ Client / Browser based attack]. o Ex: XSS ( Cross Site Scripting) o XSRF ( Cross Site Request forgery) o Phishing ( Social Eng.) and others
  • 16. Attacking Approach (Way of Attacks) • Content Injection o SQL Injection o Script Injection (XSS) o DOM element Injection (DOM based XSS) • Breaking Access-Control / Access- Restriction o Cross Domain / Cross Frame Attack o Ex. Cross Domain Capability Leaks • Exploiting Application Configuration o Session Hijacking / Credential Stealing o Failure to Restrict URL access o Insecure Cryptography
  • 17. Attacking Approach (Way of Attacks) continuing… • Insecure Network o Proxy-based attack o Man-in-the-middle attacks • Web Based Malware Attack We are more Interested on Content Injection Attack because of its wide attack surface.
  • 18. Content Injection (Through URL) Demonstrating Reflected XSS attack Sends through email / other way www.goodhost.com?search=@#badcontent#@ @#badcontent #@ Clicks the URL Client Web Browser @#badcontent #@ @#badcontent#@ @#badcontent #@ Web Server User is infected with the injection attack
  • 19. Content Injection (via comment) Demonstrating ‘Stored XSS attack’ Inserted in DB @#comment!@# Malicious content Comment Retrieved From database @#comment!@# Clicks the URL Clicks the URL Request Put Malicious comment Bob Request the same page
  • 20. Content Injection Attack (2) (What content?) • SQL ( Data Integrity & Privacy attack) • Script / JavaScript (Privacy attack – Steal Cookie) • DOM Element ( Data Integrity - Phishing ) We are more Interested in Script Injection attack (also called XSS) which is easy and obvious but impact is severe therefore critical to handle.
  • 21. Why attackers prefer JavaScript injection? • JavaScript can access almost all resources in a web page. • JavaScript is supported by all major browsers • JavaScript has great expressive power.
  • 22. Consequence of XSS attack • Sensitive Information theft. o Credential Theft ( Ex: cookies) • Intranet Scanning o Scan Open ports . • Attacking other users o Replay attack from compromised browser.
  • 23. What are the Existing Approaches to Protect XSS attacks? All the existing approaches place some kinds of restrictions over JavaScript uses. • Host based Restriction o allow JavaScript from a White listed hosts. o Restrict JavaScript from Black listed hosts. • Place holder Restriction o Restrict places where JavaScript can be inserted.
  • 24. What are the Existing Approaches to Protect XSS attacks … • Transfer Restriction o Restrict Sensitive Resources to be send out to other hosts/domains. • Content Rewrite o Re-write JavaScript to delete unsafe code. • Flow Control o Control the flow of sensitive information in JavaScript (Taint Sensitive information)
  • 25. What are other Control Points ? Control JS & DOM Interactions Output Interface Input Interface JS DOM Control Flow of User provided Sanitize URL to data Cookie discard malicious Web Server content Control JS Communication with External Domain Control Cookie Send out to External Domain Compare input / output interface data for to check user whether malicious content is Other Domains trespassed through the server .
  • 26. References: • http://stackoverflow.com/questions/1267284/common-website-attack- methods-detection-and-recovery • http://yehg.net/lab/pr0js/papers/What%20XSS%20Can%20Do.pdf