Web Browser Security John Mitchell CS 155April 19, 2005.

Slides:



Advertisements
Similar presentations
Mobile Code Security Yurii Kuzmin. What is Mobile Code? Term used to describe general-purpose executables that run in remote locations. Web browsers come.
Advertisements

Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
Chapter 17: WEB COMPONENTS
Applet Security Gunjan Vohra. What is Applet Security? One of the most important features of Java is its security model. It allows untrusted code, such.
Mobile Code Security Aviel D. Rubin, Daniel E. Geer, Jr. MOBILE CODE SECURITY, IEEE Internet Computing, 1998 Minkyu Lee
Slide 1 Vitaly Shmatikov CS 378 Mobile Code Security.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Web Security A how to guide on Keeping your Website Safe. By: Robert Black.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Security Awareness: Applying Practical Security in Your World, Second Edition Chapter 3 Internet Security.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Computer Security and Penetration Testing
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 15: Internet Explorer and Remote Connectivity Tools.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
COMPUTER TERMS PART 1. COOKIE A cookie is a small amount of data generated by a website and saved by your web browser. Its purpose is to remember information.
Cookies COEN 351 E-commerce Security. Client / Session Identification HTTP does not maintain state. State Information can be passed using: HTTP Headers.
Page 1 Sandboxing & Signed Software Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
Working with Applications Lesson 7. Objectives Administer Internet Explorer Secure Internet Explorer Configure Application Compatibility Configure Application.
INTRODUCTION TO WEB DATABASE PROGRAMMING
ITIS 1210 Introduction to Web-Based Information Systems Chapter 48 How Internet Sites Can Invade Your Privacy.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Data Security.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
FTP (File Transfer Protocol) & Telnet
1 Guide to Novell NetWare 6.0 Network Administration Chapter 13.
| | Tel: | | Computer Training & Personal Development Microsoft Office PowerPoint 2007 Expert.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
JavaScript, Fourth Edition
World Wide Web Hypertext model Use of hypertext in World Wide Web (WWW) WWW client-server model Use of TCP/IP protocols in WWW.
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
Tutorial 1: Browser Basics.
Course ILT Internet/intranet support Unit objectives Use the Internet Information Services snap-in to manage IIS, Web sites, virtual directories, and WebDAV.
Client Side Vulnerabilities Aka, The Perils of HTTP Lesson 14.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Java Security Nathan Moore CS 665. Overview Survey of Java Inherent Security Properties Java Runtime Environment Java Virtual Machine Java Security Model.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
CSCE 201 Web Browser Security Fall CSCE Farkas2 Web Evolution Web Evolution Past: Human usage – HTTP – Static Web pages (HTML) Current: Human.
Browser Security John Mitchell. Browser and Network Browser Network uBrowser sends requests May reveal private information (in forms, cookies) uBrowser.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
Module 2 – User Safety Privacy Attacks on end users Browser vulnerabilities.
Cookies COEN 351 E-commerce Security. Client / Session Identification HTTP Headers Client IP Address HTTP User Login FAT URLs Cookies.
Chapter 12: How Private are Web Interactions?. Why we care? How much of your personal info was released to the Internet each time you view a Web page?
1 Chapter Overview Creating Web Sites and FTP Sites Creating Virtual Directories Managing Site Security Troubleshooting IIS.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Overview of Servlets and JSP
Microsoft Office 2008 for Mac – Illustrated Unit D: Getting Started with Safari.
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
Windows Vista Configuration MCTS : Internet Explorer 7.0.
Web Server Administration Chapter 6 Configuring a Web Server.
Web Caching? Web Caching:.
Topic: Java Security Models
What is Cookie? Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve.
Configuring Internet-related services
COSC Assignment 3 - Part 1 Java Security Susan Kovacs 19 April 2019 COSC Assignment 3 - Part 1.
Designing IIS Security (IIS – Internet Information Service)
Presentation transcript:

Web Browser Security John Mitchell CS 155April 19, 2005

Course Schedule uProjects Project 1: Assigned April 7, Due April 21 Project 2: Assign April 21, Due May 5 Project 3: Assign May 12, Due June 2 No Late Days uHomework HW 1: Assigned April 14, Due April 28 HW 2: Assign April 28, Due May 12 HW 3: Assign May 19, Due June 2 No Late Days All assign/due dates are Thursdays (see calendar on web) June 2 is “automatic one-week extension from May 26”

Browser and Network Browser Network uBrowser sends requests May reveal private information (in forms, cookies) uBrowser receives information, code May corrupt state by running unsafe code uInteraction susceptible to network attacks Consider network security later in the course OS Hardware Web site request reply

Microsoft Issues New IE Browser Security Patch By Richard Karpinski Microsoft has released a security patch that closes some major holes in its Internet Explorer browser The so-called "cumulative patch" fixes six different IE problems... Affected browsers include Internet Explorer 5.01, 5.5 and 6.0. Microsoft rated the potential security breaches as "critical." Tuesday, February 12, 2002

Feb 2002 patch addresses: A buffer overrun associated with an HTML directive... Hackers could use this breach to run malicious code on a user's system. A scripting vulnerability that would let an attacker read files on a user's systems. A vulnerability related to the display of file names... Hackers could … misrepresent the name of a file... and trick a user into downloading an unsafe file. A vulnerability that would allow a Web page to improperly invoke an application installed on a user's system to open a file on a Web site. … more … MS announced 20 vulnerabilities on April 13, 2004 !!!

And then again this year, … Windows Security Updates Summary for April 2005 Published: April 12, 2005 A security issue has been identified that could allow an attacker to compromise a computer running Internet Explorer and gain control over it. You can help protect your computer by installing this update from Microsoft. After you install this item, you may have to restart your computer.

Browser Security Check What kind of security are they checking?

More informative test site Cookie Disclosure Clipboard Reading Program Execution File Execution Web Page Spoofing Security Zone Spoofing Hard Drive Access

Browser security topics uHTTP review uControlling outgoing information Cookies –Cookie mechanism, JunkBuster Routing privacy –Anonymizer, Crowds Privacy policy – P3P uRisks from incoming executable code JavaScript ActiveX Plug-ins Java

HyperText Transfer Protocol uUsed to request and return data Methods: GET, POST, HEAD, … uStateless request/response protocol Each request is independent of previous requests Statelessness has a significant impact on design and implementation of applications uEvolution HTTP 1.0: simple HTTP 1.1: more complex HTTP

GET /default.asp HTTP/1.0 Accept: image/gif, image/x-bitmap, image/jpeg, */* Accept-Language: en User-Agent: Mozilla/1.22 (compatible; MSIE 2.0; Windows 95) Connection: Keep-Alive If-Modified-Since: Sunday, 17-Apr-96 04:32:58 GMT HTTP Request MethodFileHTTP versionHeaders Data – none for GET Blank line

HTTP/ OK Date: Sun, 21 Apr :20:42 GMT Server: Microsoft-Internet-Information-Server/5.0 Connection: keep-alive Content-Type: text/html Last-Modified: Thu, 18 Apr :39:05 GMT Content-Length: 2543 Some data... blah, blah, blah HTTP Response HTTP versionStatus codeReason phrase Headers Data

HTTP Server Status Codes CodeDescription 200OK 201Created 301Moved Permanently 302Moved Temporarily 400Bad Request – not understood 401Unauthorized 403Forbidden – not authorized 404Not Found 500Internal Server Error u Return code 401 Used to indicate HTTP authorization HTTP authorization has serious problems!!!

Primitive Browser Session shopping.cfm? pID=269 View Catalog shopping.cfm? pID=269& item1= checkout.cfm? pID=269& item1= Check outSelect Item Store session information in URL; Easily read on network

Store info across sessions? uCookies A cookie is a file created by an Internet site to store information on your computer Browser Server Enters form data Stores cookie Browser Server Requests cookie Returns data Http is stateless protocol; cookies add state

Browser Cookie Management uCookie Ownership Once a cookie is saved on your computer, only the Web site that created the cookie can read it. uVariations Temporary cookies –Stored until you quit your browser Persistent cookies –Remain until deleted or expire Third-party cookies –Originates on or sent to another Web site

Third-Party Cookies uYahoo! Privacy Center Yahoo! sends most of the advertisements you see However, we also allow … third-party ad servers … to serve advertisements Because your web browser must request these … from the ad network web site, these companies can send their own cookies to your cookie file... Opting Out of Third-Party Ad Servers –“If you want to prevent a third-party ad server from sending and reading cookies on your computer, currently you must visit each ad network's web site individually and opt out (if they offer this capability).”

Example: Mortgage Center Mortgage Center … What’s this?

Cookie issues Cookies maintain record of your browsing habits –Cookie stores information as set of name/value pairs –May include any information a web site knows about you –Sites track your activity from multiple visits to site Sites can share this information (e.g., DoubleClick) –Sites using DoubleClick place small graphic that causes user to request page from DoubleClick (see previous slide) –DoubleClick uses cookies to identify you on various sites Site can generate user ID from its own cookie and pass to DoubleClick or other site in the URL Browser attacks could invade your “privacy” 08 Nov 2001 Users of Microsoft's browser and programs could be vulnerable to having their browser cookies stolen or modified due to a new security bug in Internet Explorer (IE), the company warned today.

Managing cookie policy via proxy Browser Proxy Network uProxy intercepts request and response uMay modify cookies before sending to Browser uCan do other checks: filter ads, block sites, etc. Cookie Jar

Sample Proxy: uCookie management by policy in cookiefile Default: all cookies are silently crunched Options –Allow cookies only to/from certain sites –Block cookies to browser (but allow to server) –Send vanilla wafers instead uBlock URLs matching any pattern in blockfile Example: pattern /*.*/ad matches Easy to write your own http proxy; you can try this at home

Preserving web privacy uYour IP address may be visible to web sites This may reveal your employer, ISP, etc. Can link activities on different sites, different times uCan you prevent sites from learning about you? Anonymizer –Single site that hides origin of web request Crowds –Distributed solution

Browsing Anonymizers uWeb Anonymizer hides your IP address uWhat does anonymizer.com know about you? Browser Server Anonymizer cgi-bin/redirect.cgi?url=…

Related approach to anonymity uHide source of messages by routing them randomly uRouters don’t know for sure if the apparent source of the message is the actual sender or simply another router Only secure against local attackers! uExisting systems: Freenet, Crowds, etc.

Crowds [Reiter,Rubin ‘98] C C4C4 C1C1 C2C2 C C C C3C3 C0C0 sender recipient C C C C pfpf 1-p f uSender randomly chooses a path through the crowd uSome routers are honest, some corrupt uAfter receiving a message, honest router flips a coin With probability P f routes to the next member on the path With probability 1- P f sends directly to the recipient

What Does Anonymity Mean? uBeyond suspicion The observed source of the message is no more likely to be the actual sender than anybody else uProbable innocence Probability <50% that the observed source of the message is the actual sender uPossible innocence Non-trivial probability that the observed source of the message is not the actual sender Guaranteed by Crowds if there are sufficiently few corrupt routers

Something you can try at home uFind out what sites know about you Anonymizer.com, other sites will tell you want they can find about your IP address Many other sites offer this too … Try Private Surfing FREE! Make your online activities invisible and untrackable to online snoops. Just type a URL & click “GO.”Private Surfing GO Also: free privacy toolbar (?)

How web sites use your information uYou may enter information to buy product Name, address, credit card number, … uHow will web site use this information Charge your card and mail your purchase Give sales information to other businesses? uPlatform for privacy preferences (P3P) Framework for reaching agreement on use of personal information Enforcement at server side is another matter…

Basic P3P Concepts user agent user data repository preferences service proposal agreement user data practices Credit: Lorrie Cranor

A Simple P3P Conversation user agent service User agent: Get index.html Service: Here is my P3P proposal - I collect click- stream data and computer information for web site and system administration and customization of site User agent: OK, I accept your proposal Service: Here is index.html

Controlling information from web uData is harmless (?) uRisks come from code received from web Scripts in web pages ActiveX controls and Browser extensions Applets Browser Server Risk to browser?

JavaScript uLanguage executed by browser uUsed in many attacks (to exploit other vulnerabilities) Cookie attack from earlier slide (08 Nov 2001): With the assistance of some JavaScript code, an attacker could construct a Web page or HTML- based that could access any cookie in the browser's memory or those stored on disk... uJavaScript runs Before the HTML is loaded, before the document is viewed While the document is viewed, or as the browser is leaving

PwdHash browser extension uExtra code that reads user pwd, applies hash Provide unique, high-quality password Stronger authentication with existing servers uProblem Javascript on malicious web page can try to intercept user password from PwdHash Javascript properties –Script activated with user changes focus –Script can read input, may run before PwdHash Keyboard monitoring and logging Spoof parts of web browser UI Communicate across network

ActiveX uActiveX controls reside on client's machine, activated by HTML object tag on the page ActiveX controls are not interpreted by browser Compiled binaries executed by client OS Controls can be downloaded and installed uSecurity model relies on three components Digital signatures to verify source of binary IE policy can reject controls from network zones Controls marked by author as safe for initialization, safe for scripting which affects the way control used Once accepted, installed and started, no control over execution

Installing Controls If you install and run, no further control over the code. In principle, browser/OS could apply sandboxing, other techniques for containing risks in native code.

Risks associated with controls uMSDN Warning An ActiveX control can be an extremely insecure way to provide a feature uWhy? A COM object, control can do any user action –read and write Windows registry –access the local file system Other web pages can attack a control –Once installed, control can be accessed by any page –Page only needs to know class identifier (CLSID) uRecommendation: use other means if possible

IE Browser Helper Objects (Extensions) uCOM components loaded when IE starts up uRun in same memory context as the browser uPerform any action on IE windows and modules Detect browser events –GoBack, GoForward, and DocumentComplete Access browser menu, toolbar and make changes Create windows to display additional information Install hooks to monitor messages and actions uSummary: No protection from extensions

Java uJava is general programming language uWeb pages may contain Java code uJava executed by Java Virtual Machine Special security measures associated with Java code from remote URLs

Java Applet uLocal window uDownload Seat map Airline data uLocal data User profile Credit card uTransmission Select seat Encrypted msg

Security Risks uAnnoyance or inconvenience Display large window that ignores mouse input Play irritating sound and do not stop Consume CPU cycles, memory, network bandwidth … uExport confidential information Communication is generally possible Prevent access to password file, credit card number, … Subtle attack: trick dialog boxes... uModify or compromise system Delete files, call system functions

Mobile code security mechanisms uExamine code before executing Java bytecode verifier performs critical tests Beyond the Browser: code modification –Replace standard calls by calls to “safe” versions –Check parameters to standard methods to make sure they are in appropriate ranges uInterpret code and trap risky operations Java bytecode interpreter does run-time tests Security manager applies local access policy

Java Background uCompiler and Virtual Machine Compiler produces bytecode Virtual machine loads classes on demand, verifies bytecode properties, interprets bytecode uWhy this design? Portability –Transmit bytecode across network Minimize machine-dependent part of implementation –Do optimization on bytecode when possible –Keep bytecode interpreter simple

A.classA.java Java Compiler B.class Loader Verifier Linker Bytecode Interpreter Java Virtual Machine Compile source code Network Java Virtual Machine Architecture

Class loader uRuntime system loads classes as needed When class is referenced, loader searches for file of compiled bytecode instructions uDefault loading mechanism can be replaced Define alternate ClassLoader object –Extend the abstract ClassLoader class and implementation Can obtain bytecodes from network –VM restricts applet communication to site that supplied applet

Verifier uBytecode may not come from standard compiler Evil hacker may write dangerous bytecode uVerifier checks correctness of bytecode Every instruction must have a valid operation code Every branch instruction must branch to the start of some other instruction, not middle of instruction Every method must have a structurally correct signature Every instruction obeys the Java type discipline Last condition is fairly complicated.

Why is typing a security feature? uJava security mechanisms rely on type safety uExamples General: Unchecked cast lets prog make any call int (*fp)() /* variable "fp" is a function pointer */... fp = addr; /* assign address stored in an integer var */ (*fp)(n); /* call the function at this address */ Security manager has private fields that store permission information –Access to these fields would defeat the security mechanism

Type Safety of JVM uLoad-time type checking uRun-time type checking All casts are checked to make sure type safe All array references are checked to be within bounds References are tested to be not null before dereference uAdditional features Automatic garbage collection NO pointer arithmetic If program accesses memory, the memory is allocated to the program and declared with correct type

How do we know verifier is correct? uMany early attacks based on verifier errors uFormal studies prove correctness Abadi and Stata Freund and Mitchell –Found error in initialize-before-use analysis

JVM uses stack machine uJava Class A extends Object { int i void f(int val) { i = val + 1;} } uBytecode Method void f(int) aload 0 ; object ref this iload 1 ; int val iconst 1 iadd ; add val +1 putfield #4 return data area local variables operand stack Return addr, exception info, Const pool res. JVM Activation Record refers to const pool

Java Object Initialization uNo easy pattern to match. uMultiple refs to same uninitialized object.

Bug in Sun’s JDK uExample: variables 1 and 2 contain references to two different objects, verifier thinks they are aliases

Java Security Mechanisms uSandboxing Run program in restricted environment –Analogy: child’s sandbox with only safe toys This term refers to –Features of loader, verifier, interpreter that restrict program –Java Security Manager, a special object that acts as access control “gatekeeper” uCode signing Use cryptography to determine who wrote class file –Info used by security manager

Java Sandbox uFour complementary mechanisms Class loader –Separate namespaces for separate class loaders –Associates protection domain with each class Verifier and JVM run-time tests –NO unchecked casts or other type errors, NO array overflow –Preserves private, protected visibility levels Security Manager –Called by library functions to decide if request is allowed –Uses protection domain associated with code, user policy –Enforcement uses stack inspection

Security Manager u Java library functions call security manager uSecurity manager object answers at run time Decide if calling code is allowed to do operation Examine protection domain of calling class –Signer: organization that signed code before loading –Location: URL where the Java classes came from Uses the system policy to decide access permission

Sample SecurityManager methods checkExecChecks if the system commands can be executed. checkReadChecks if a file can be read from. checkWriteChecks if a file can be written to. checkListenChecks if a certain network port can be listened to for connections. checkConnectChecks if a network connection can be created. checkCreate ClassLoader Check to prevent the installation of additional ClassLoaders.

Stack Inspection u Permission depends on Permission of calling method Permission of all methods above it on stack –Up to method that is trusted and asserts this trust Many details omitted java.io.FileInputStream method f method g method h Stories: Netscape font / passwd bug; Shockwave plug-in

Beyond JVM security uJVM does not prevent Denial of service attacks –Applet creates large windows and ignores mouse Certain network behavior –Applet can connect to port 25 on client machine, forge (on some implementations) URL spoofing –Applet can write false URL on browser status line Annoying behavior –Applet can play loud sound –Applet can reload pages in new windows

Modify code in proxy [Shin, M…] Browser Proxy Network uProxy intercepts request for page uMay modify before sending to browser uCan do other checks: filter ads, block sites, etc. UI Additional Security

Bytecode Modification Techniques uClass-level replacement Define subclass of library (or other) class Replace references to class with subclass (const pool) Works because of subtyping Not possible if class is final uMethod-level replacement Change function calls to new function Generally, check or modify arguments and call original function

Sample bytecode modification uSafeWindow class Subclass of standard Window class –Do not allow windows larger than maximum –Do not allow more than max number of windows uRestrict network activity Replace call to Socket object constructor –Do not allow socket connection to port 25 uMaintain appearance of browser window Replace calls to AppletContext methods –Displayed URL must match actual hyperlink

Summary: Browser security uBrowser uses network and local disk Potential for outside access to local data uBrower interprets code from network HTML, JavaScript, ActiveX, Java uBrowser installs, executes plug-ins Acrobat, Shockwave, … uMalicious code can pose risks Consume resources, Steal information, Compromise system We’ll see many of these issues in other forms when we discuss OS security, network security