the most dangerous code in the browser
play

The Most Dangerous Code in the Browser Stefan Heule, Devon Rifkin, - PowerPoint PPT Presentation

The Most Dangerous Code in the Browser Stefan Heule, Devon Rifkin, Alejandro Russo, Deian Stefan Modern web experience Modern web experience Modern web experience Web apps Extensions AdBlock NYTimes Chase Evernote Core browser Web


  1. The Most Dangerous Code in the Browser Stefan Heule, Devon Rifkin, Alejandro Russo, Deian Stefan

  2. Modern web experience

  3. Modern web experience

  4. Modern web experience Web apps Extensions AdBlock … NYTimes Chase Evernote Core browser

  5. Web app security • Trust model: malicious code ❌ NYTimes Chase Web APIs Core browser • Apps are isolated according to same-origin policy • Apps are constrained to Web APIs (e.g., DOM) ➤ They cannot access arbitrary files, devices, etc.

  6. Extension security? NYTimes AdBlock Privileged APIs Core browser • Extensions need direct access to app DOMs ➤ They modify app style, content, behavior, … • Extensions need privileged APIs ➤ To fetch/store cross-origin content, to read/modify history and bookmarks, to create new tabs, etc.

  7. Chrome extension security model • Trust model: extensions are benign-but-buggy NYTimes AdBlock • Privilege separate extension: core and content ➤ Protects vulnerable extension from malicious apps • Run extensions with least privilege ➤ Limits damage due to exploits

  8. 
 Least privilege via permission system • Extensions declare necessary permissions 
 { "name": “AdBlock Plus", "version": "2.1.10", ... "permissions": [ "http://*/*", "https://*/*", "contextMenus" ], ... • Users must grant permissions at install time

  9. What does mean? • Can read and modify data on any site, regardless of what site you are visiting NYTimes AdBlock chase.com • AdBlock must be a special case, right? ➤ 71.6% of top 500 extensions need this privilege!

  10. What does mean? • Can read and modify data on any site, regardless of what site you are visiting NYTimes AdBlock chase.com • AdBlock must be a special case, right? ➤ 71.6% of top 500 extensions need this privilege!

  11. It gets worse with popularity 1.2 10000000 Fraction that can read and change … Number of users (few days later) 1 1000000 0.8 100000 0.6 10000 0.4 1000 0.2 100 0 10 1 51 101 151 201 251 301 351 401 451 Top n extensions

  12. It gets worse with popularity 1.2 10000000 Fraction that can read and change … Number of users (few days later) 1 1000000 0.8 100000 0.6 10000 % of n that can read and change all your data… 0.4 1000 0.2 100 0 10 1 51 101 151 201 251 301 351 401 451 Top n extensions

  13. It gets worse with popularity 1.2 10000000 Fraction that can read and change … Number of users (few days later) 1 1000000 # of users 0.8 100000 0.6 10000 % of n that can read and change all your data… 0.4 1000 0.2 100 0 10 1 51 101 151 201 251 301 351 401 451 Top n extensions

  14. It gets worse with popularity Removed from Chrome Web Store 1.2 10000000 Fraction that can read and change … Number of users (few days later) 1 1000000 # of users 0.8 100000 0.6 10000 % of n that can read and change all your data… 0.4 1000 0.2 100 0 10 1 51 101 151 201 251 301 351 401 451 Top n extensions

  15. Problem with Chrome’s model • Permission requests are meaningless ➤ Descriptions are broad and context-independent • Model encourages principle of most privilege ➤ Extensions don’t auto-update if they need more privs • Threat model is not realistic ➤ Chrome Web Store listed many malicious extensions ➤ Roughly 5% of Google users run malicious extensions

  16. Problem with Chrome’s model • Permission requests are meaningless ➤ Descriptions are broad and context-independent • Model encourages principle of most privilege ➤ Extensions don’t auto-update if they need more privs • Threat model is not realistic ➤ Chrome Web Store listed many malicious extensions ➤ Roughly 5% of Google users run malicious extensions

  17. Problem with Chrome’s model • Permission requests are meaningless ➤ Descriptions are broad and context-independent • Model encourages principle of most privilege ➤ Extensions don’t auto-update if they need more privs • Threat model is not realistic ➤ Chrome Web Store listed many malicious extensions ➤ Roughly 5% of Google users run malicious extensions

  18. New extension-system goals • Meaningful permission system ➤ Safe behavior should not require permission ➤ Permissions requests should be content-specific • Model should encourage least privilege ➤ Permissions should be fine-grained ➤ Incentivize safe extensions • Threat model: extensions may be malicious ➤ Need to also protect user app data from extensions

  19. New extension-system goals • Meaningful permission system ➤ Safe behavior should not require permission ➤ Permissions requests should be content-specific • Model should encourage least privilege ➤ Permissions should be fine-grained ➤ Incentivize safe extensions • Threat model: extensions may be malicious ➤ Need to also protect user app data from extensions

  20. New extension-system goals • Meaningful permission system ➤ Safe behavior should not require permission ➤ Permissions requests should be content-specific • Model should encourage least privilege ➤ Permissions should be fine-grained ➤ Incentivize safe extensions • Threat model: extensions may be malicious ➤ Need to also protect user app data from extensions

  21. 
 
 
 How can we do this? Insight: it is safe for extension to read user data if it can’t arbitrarily disseminate it ➤ E.g., Google Mail Checker 
 Checker gmail.com ➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy

  22. 
 
 
 How can we do this? Insight: it is safe for extension to read user data if it can’t arbitrarily disseminate it ✗ ➤ E.g., Google Mail Checker 
 Checker gmail.com ➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy

  23. 
 
 
 How can we do this? Insight: it is safe for extension to read user data if it can’t arbitrarily disseminate it ✗ ➤ E.g., Google Mail Checker 
 Checker gmail.com ➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy

  24. 
 
 
 How can we do this? Insight: it is safe for extension to read user data if it can’t arbitrarily disseminate it ✗ ➤ E.g., Google Mail Checker 
 Checker gmail.com ➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy

  25. 
 
 
 How can we do this? Insight: it is safe for extension to read user data if it can’t arbitrarily disseminate it ✗ ➤ E.g., Google Mail Checker 
 Checker gmail.com ➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy

  26. 
 
 
 How can we do this? Insight: it is safe for extension to read user data if it can’t arbitrarily disseminate it ✗ ➤ E.g., Google Mail Checker 
 Checker ❌ gmail.com evil.gov ➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy

  27. Safely read and modify pages?

  28. Safely read and modify pages? ✗

  29. 
 
 Safely read and modify pages? • Idea: tie extension script with app page ➤ Impose at least same-origin policy on extension 
 NYTimes AdBlock ❌ chase.com • Challenge: read data from page and leak it by injecting content into page’s DOM • Solution: taint extension, write to isolated DOM ➤ Loads due to extension restricted: confined!

  30. 
 
 Safely read and modify pages? • Idea: tie extension script with app page ➤ Impose at least same-origin policy on extension 
 NYTimes AdBlock ❌ chase.com • Challenge: read data from page and leak it by injecting content into page’s DOM • Solution: taint extension, write to isolated DOM ➤ Loads due to extension restricted: confined!

  31. Confinement: safe, too restricting • Challenge: extensions need to “leak” data ➤ E.g., Evernote is used to save URL, page, etc. ➤ Reading DOM taints extension: NYTimes Evernote ❌ evernote.com • Solution: declassification via sharing menu API NYTimes

  32. Confinement: safe, too restricting • Challenge: extensions need to “leak” data ➤ E.g., Evernote is used to save URL, page, etc. ➤ Reading DOM taints extension: NYTimes Evernote ❌ evernote.com • Solution: declassification via sharing menu API NYTimes

  33. Confinement: safe, too restricting • Challenge: extensions need to “leak” data ➤ E.g., Evernote is used to save URL, page, etc. ➤ Reading DOM taints extension: NYTimes Evernote ❌ evernote.com • Solution: declassification via sharing menu API NYTimes

  34. Confinement: safe, too restricting • Challenge: extensions need to “leak” data ➤ E.g., Evernote is used to save URL, page, etc. ➤ Reading DOM taints extension: NYTimes Evernote ❌ evernote.com • Solution: declassification via sharing menu API NYTimes

  35. Confinement: safe, too restricting • Challenge: extensions need to “leak” data ➤ E.g., Evernote is used to save URL, page, etc. ➤ Reading DOM taints extension: NYTimes Evernote ❌ evernote.com • Solution: declassification via sharing menu API NYTimes Evernote

Recommend


More recommend