cse$484$/$cse$m584 computer$security:$ web$security$€¦ · cse$484$/$cse$m584 $...

23
CSE 484 / CSE M 584 Computer Security: Web Security TA: Franzi Roesner [email protected]

Upload: others

Post on 18-Jul-2020

38 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

CSE  484  /  CSE  M  584  Computer  Security:  

Web  Security  

TA:  Franzi  Roesner  [email protected]  

Page 2: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

LogisGcs  

•  Homework  #2  (crypto)  due  2/22  5pm.  •  Lab  #2  (web  security)  due  2/27  5pm.  –  If  you  haven’t  signed  up  your  group  yet  (email  me  UW  NetIDs,  groups  name,  password),  do  it  now!  

– Not  just  any  SQL  injecGon  will  work.  

Page 3: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

SQL  InjecGon  

What  if  this  web  app  does  something  like  this:    select * from users where user_name='$user' and user_password=‘$password’!  

AZacker  can  log  in  by  entering  the  username:  a' or '1'='1’; --!

Why?  SQL  will  execute:    select * from users where user_name = ‘a’ or ‘1’=‘1’;!

Page 4: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

SQL  InjecGon  

What  if  this  web  app  does  something  like  this:    select * from users where user_name='$user' and user_password=‘$password’!  

AZacker  can  execute  arbitrary  SQL                                commands  by  entering  the  user  name:  

a’; <Other Commands> --!!

For  example:  a’; DROP TABLE users; --!

Page 5: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

SQL  InjecGon  

[hZp://xkcd.com/327/]  

Page 6: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Clickjacking  using  the  Cursor  

[Figure  from  Huang  et  al.,  “Clickjacking:  AZacks  and  Defenses”,  USENIX  Security,  2012]  

Page 7: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Other  Web  Security  Resources  

•  Web  Security  Codelab:hZp://google-­‐gruyere.appspot.com/  

•  hZp://uwcg.cs.washington.edu/learntocook.php  

•  Clickjacking:  hZp://www.grc.com/sn/notes-­‐168.htm    

•  SQL  InjecGon:  hZp://sqlzoo.net/hack/    

Page 8: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$
Page 9: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

DetecGng  and  Defending  Against  Third-­‐Party  Tracking  on  the  Web  

Franziska  Roesner,  Tadayoshi  Kohno,  David  Wetherall  

Page 10: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Third-­‐Party  Web  Tracking  

10  

Tracker.com  

AdverGse.com  

Bigger  browsing  profiles          =  increased  value  for  trackers  =  reduced  privacy  for  users    

(HypotheGcal  tracking  relaGonships  only.)  

Page 11: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Tracking  is  Complicated  

•  Much  discussion  of  tracking,  but  limited  understanding  of  how  it  actually  works.  

•  Our  goals:    – Understand  the  tracking  ecosystem.  

•  How  is  tracking  actually  done  in  the  wild?  • What  kinds  of  browsing  profiles  do  trackers  compile?  •  How  effecGve  are  defenses  available  to  users?  

– Address  gaps  with  new  defense  (ShareMeNot).  

11  

Page 12: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Mechanisms  Required  By  Trackers  

•  Ability  to  store  user  idenGty  in  the  browser  –  Browser  cookies  – HTML5  LocalStorage  and  Flash  cookies  (LSOs)  – Not  considering  more  exoGc  storage  mechanisms  or  approximate  fingerprinGng  

•  Ability  to  communicate  visited  page  and  user  idenGty  back  to  tracker  –  IdenGty:  Cookies  aZached  to  requests  –  Visited  page:  HTTP  referrers  –  Both:  scripts  that  embed  informaGon  in  URLs  

12  

Page 13: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Tracking:  The  Simple  Version  

•  Within-­‐Site:    

•  Cross-­‐Site:  

13  

logs  

Cookie  Database  

tracker.com: id=789

hZp://site1.com  

processing  engine  

cookie: id=789

9:30am: user 789 visited site1.com

<iframe src=tracker.com/ad.html>!!!!!</iframe>!

ad  9:31am: user 789 visited site2.com

hZp://site2.com  

cookie: id=789

tracker.com  

First-­‐party  cookies  are  used  to  track  repeat  visits  to  a  site.  

Third-­‐party  cookies  are  used  by  trackers  included  in  other  sites  to  create  profiles.    

Page 14: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Our  Tracking  Taxonomy  Name   Scope   User  Visits  

Directly?  Overview  

N/A     Within-­‐Site   Yes   Site  does  its  own  on-­‐site  analyGcs.  

AnalyGcs   Within-­‐Site   No   Site  uses  third-­‐party  analyGcs  engine  (e.g.,  Google  AnalyGcs).  

Vanilla   Cross-­‐Site   No   Site  embeds  third-­‐party  tracker  that  uses  third-­‐party  storage  (e.g.,  Doubleclick).  

Forced   Cross-­‐Site   Yes  (forced)   Site  embeds  third-­‐party  tracker  that  forced  the  user  to  visit  directly  (e.g.,  via  popup).  

Referred   Cross-­‐Site   No   Tracker  relies  on  another  cross-­‐site  tracker  to  leak  unique  idenGfier  values.  

Personal   Cross-­‐Site   Yes   Site  embeds  third-­‐party  tracker  that  the  user  otherwise  visits  directly  (e.g.,  Facebook).  

14  

Evolu>on:  Embedding  analy>cs  libraries    

Evolu>on:  Third-­‐party  cookie  blocking  

Page 15: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Quirks  of  Third-­‐Party  Cookie  Blocking  

•  OpGon  blocks  the  seEng  of  third-­‐party  cookies:  all  browsers  

•  OpGon  blocks  the  sending  of  third-­‐party  cookies:  only  Firefox  

•  Result:  Once  a  third-­‐party  cookie  is  somehow  set,  it  can  be  used  (in  most  browsers).  

15  15  

Page 16: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Our  Tracking  Taxonomy  

16  

Name   Scope   User  Visits  Directly?  

Overview  

N/A     Within-­‐Site   Yes   Site  does  its  own  on-­‐site  analyGcs.  

AnalyGcs   Within-­‐Site   No   Site  uses  third-­‐party  analyGcs  engine  (e.g.,  Google  AnalyGcs).  

Vanilla   Cross-­‐Site   No   Site  embeds  third-­‐party  tracker  that  uses  third-­‐party  storage  (e.g.,  Doubleclick).  

Forced   Cross-­‐Site   Yes  (forced)   Site  embeds  third-­‐party  tracker  that  forced  the  user  to  visit  directly  (e.g.,  via  popup).  

Referred   Cross-­‐Site   No   Tracker  relies  on  another  cross-­‐site  tracker  to  leak  unique  idenGfier  values.  

Personal   Cross-­‐Site   Yes   Site  embeds  third-­‐party  tracker  that  the  user  otherwise  visits  directly  (e.g.,  Facebook).  

Evolu>on:  Complex  ad  networks  

Evolu>on:  Embedding  analy>cs  libraries    

Evolu>on:  Third-­‐party  cookie  blocking  

Page 17: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

tracker.com  

Cookie  Database  

tracker.com: id=522

hZp://site1.com  <iframe src=tracker.com/ad.html>!!!!!</iframe>!

ad  

othertracker.com/track?id=522&referrer=site1.com

2:34pm: site1.com: user 522

hZp://site2.com  <iframe src=tracker.com/ad.html>!!!!!</iframe>!

ad  

othertracker.com/track?id=522&referrer=site2.com

2:35pm: site2.com: user 522

logs  processing  engine  othertracker.com  

processing  engine  

17  

Referred  Tracking  

Page 18: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Name   Scope   User  Visits  Directly?  

Overview  

N/A     Within-­‐Site   Yes   Site  does  its  own  on-­‐site  analyGcs.  

AnalyGcs   Within-­‐Site   No   Site  uses  third-­‐party  analyGcs  engine  (e.g.,  Google  AnalyGcs).  

Vanilla   Cross-­‐Site   No   Site  embeds  third-­‐party  tracker  that  uses  third-­‐party  storage  (e.g.,  Doubleclick).  

Forced   Cross-­‐Site   Yes  (forced)   Site  embeds  third-­‐party  tracker  that  forced  the  user  to  visit  directly  (e.g.,  via  popup).  

Referred   Cross-­‐Site   No   Tracker  relies  on  another  cross-­‐site  tracker  to  leak  unique  idenGfier  values.  

Personal   Cross-­‐Site   Yes   Site  embeds  third-­‐party  tracker  that  the  user  otherwise  visits  directly  (e.g.,  Facebook).  

Our  Tracking  Taxonomy  

18  

Evolu>on:  Social  networks  

Evolu>on:  Complex  ad  networks  

Evolu>on:  Embedding  analy>cs  libraries    

Evolu>on:  Third-­‐party  cookie  blocking  

Anonymous  

Page 19: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Measurement  Study  

•  Tool:  TrackingTracker  Firefox  add-­‐on  that  crawls  the  web  and  automaGcally  categorizes  trackers.  

•  3  data  sets  – Alexa  Top  500  

•  5  pages  per  domain:  main  page  and  up  to  4  links  

– Alexa  Non-­‐Top  500  •  Sites  ranked  #501,  #601,  #701,  etc.  •  5  pages  per  domain:  main  page  and  up  to  4  links  

– AOL  search  logs  •  300  unique  queries  for  35  random  users  

 19  

Page 20: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

Tracking  Prevalence  (Top  500)  •  524  unique  trackers  on  500  domains  

20  

457  domains  (91%)  embed  at  least  one  tracker.  (97%  of  those  include  at  least  one  cross-­‐site  tracker.)  

    50%  of  domains  embed  

between  4  and  5  trackers.  

One  domain  includes    43  trackers.  

Page 21: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

21  

!"#$

!%#$!%&$"!$

'%$ (&$ (($ (%$ ))$ )*$ )*$ *#$ *+$ *'$

!&($!(#$

#)$

)($ )%$

*#+$

%$

&%$

!%%$

!&%$

*%%$

*&%$

)%%$

)&%$

(%%$

,--,./0121.345675-8$

9-:;./5.<5=72/>$

?15/;--=75-8$

,--,./75-8$

65-@/51@9@/6/1@5A75-8$

B:12>6/@C/75-8$

>D<E/@75-8$

1>98>75-8$

3</.98

121,/@75-8$

<8@[email protected]<9/75-8$

@/C65<72/>$

19C/@46<2,75-8$

199>A<675-8$

192F675-8$

<2C<>/8/9<175-8$

6/@C<2,063675-8$

3-:>:;/75-8$

199>A<659275-8$

;.:/=1<75-8$

8/9<1G./F75-8$

!"#$%&"'(

"&)#*&+$&',-'./0

#1+23'

!/4'56'!"#$%&"2'/+'!/4'766'./0#1+2'

H<>A<20I<>/$

J@-660I<>/$KL/@6-21.M$

J@-660I<>/$KN2-238-:6M$

Page 22: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

22  

!"#!"$!"%!"&!"

'!!"'#!"'$!"'%!"'&!"#!!"

()*+,-.,/.012-3"

45.-+))01.)6"

7))7,-1.)6"

8.)9-.59(9-8-59.:1.)6"

;*5238-9<-1.)6"

3=/>-91.)6"

53(631.)6"

?/-,(6

5257-91.)6"

/69=)9,(=/(-1.)6"

9-<8./12-3"

5(<-9@8/271.)6"

5((3:/81.)6"

5(2A81.)6"

/2</3-6-(/51.)6"

8-9</27B8?81.)6"

?)*3*+-1.)6"

5((3:/8.(21.)6"

+,*-05/1.)6"

6-(/5C,-A1.)6"

#)D12-3"

!"#$

%&'()*&'+,'!-.&/0'

123'4/&"/5'!"#$%&'()*&/'67'8#9':;'<"#//=()>&'8"-?@&"/'

Each  line  represents  one  user.  

Doubleclick:    Avg  39%  (Max  66%)  

Facebook:  Avg  23%  (Max  45%)  

Google:  Avg  21%  (Max  61%)  

Page 23: CSE$484$/$CSE$M584 Computer$Security:$ Web$Security$€¦ · CSE$484$/$CSE$M584 $ Computer$Security:$ Web$Security$ TA:$Franzi$Roesner$ franzi@cs.washington.edu$

•  Surprisingly  liZle  use  of  these  mechanisms!  •  Of  524  trackers  on  Alexa  Top  500:  – Only  5  set  unique  idenGfiers  in  LocalStorage  – 35  set  unique  idenGfiers  in  Flash  cookies  

•  Respawning:  – LS  à  Cookie:  1  case;  Cookie  à  LS:  3  cases  – Flashà  Cookie:  6  cases;  Cookie  à  Flash:  7  cases  

LocalStorage  and  Flash  Cookies  

23