The Most Dangerous Code in the Browser
Stefan Heule, Devon Rifkin, Alejandro Russo, Deian StefanThe Most Dangerous Code in the Browser Stefan Heule, Devon Rifkin, - - PowerPoint PPT Presentation
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
Modern web experience
Modern web experience
Modern web experience
…
Core browser
Evernote AdBlock NYTimes ChaseWeb apps Extensions
Web app security
- Trust model: malicious code
- Apps are isolated according to same-origin policy
- Apps are constrained to Web APIs (e.g., DOM)
Core browser
NYTimes Chase Web APIs❌
Extension security?
- Extensions need direct access to app DOMs
- Extensions need privileged APIs
history and bookmarks, to create new tabs, etc.
NYTimes AdBlockCore browser
Privileged APIs- Trust model: extensions are benign-but-buggy
- Privilege separate extension: core and content
- Run extensions with least privilege
Chrome extension security model
NYTimes AdBlockLeast privilege via permission system
- Extensions declare necessary permissions
- Users must grant permissions at install time
What does mean?
- Can read and modify data on any site,
regardless of what site you are visiting
- AdBlock must be a special case, right?
What does mean?
- Can read and modify data on any site,
regardless of what site you are visiting
- AdBlock must be a special case, right?
It gets worse with popularity
10 100 1000 10000 100000 1000000 10000000 0.2 0.4 0.6 0.8 1 1.2 1 51 101 151 201 251 301 351 401 451 Top n extensions Number of users (few days later) Fraction that can read and change …It gets worse with popularity
10 100 1000 10000 100000 1000000 10000000 0.2 0.4 0.6 0.8 1 1.2 1 51 101 151 201 251 301 351 401 451 % of n that can read and change all your data… Top n extensions Number of users (few days later) Fraction that can read and change …It gets worse with popularity
10 100 1000 10000 100000 1000000 10000000 0.2 0.4 0.6 0.8 1 1.2 1 51 101 151 201 251 301 351 401 451 # of users % of n that can read and change all your data… Top n extensions Number of users (few days later) Fraction that can read and change …It gets worse with popularity
10 100 1000 10000 100000 1000000 10000000 0.2 0.4 0.6 0.8 1 1.2 1 51 101 151 201 251 301 351 401 451 # of users % of n that can read and change all your data… Top n extensions Number of users (few days later) Fraction that can read and change … Removed from Chrome Web StoreProblem with Chrome’s model
- Permission requests are meaningless
- Model encourages principle of most privilege
- Threat model is not realistic
Problem with Chrome’s model
- Permission requests are meaningless
- Model encourages principle of most privilege
- Threat model is not realistic
Problem with Chrome’s model
- Permission requests are meaningless
- Model encourages principle of most privilege
- Threat model is not realistic
New extension-system goals
- Meaningful permission system
- Model should encourage least privilege
- Threat model: extensions may be malicious
New extension-system goals
- Meaningful permission system
- Model should encourage least privilege
- Threat model: extensions may be malicious
New extension-system goals
- Meaningful permission system
- Model should encourage least privilege
- Threat model: extensions may be malicious
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➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy Checker gmail.com
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➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy
✗
Checker gmail.comHow 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➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy
✗
Checker gmail.comHow 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➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy
✗
Checker gmail.comHow 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➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy
✗
Checker gmail.comHow 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➤ Taint extensions according to what it reads ➤ Confine code to protect user’s privacy
✗
Checker evil.gov❌
gmail.comSafely read and modify pages?
Safely read and modify pages?
✗
Safely read and modify pages?
- Idea: tie extension script with app page
- Challenge: read data from page and leak it by
injecting content into page’s DOM
- Solution: taint extension, write to isolated DOM
❌
Safely read and modify pages?
- Idea: tie extension script with app page
- Challenge: read data from page and leak it by
injecting content into page’s DOM
- Solution: taint extension, write to isolated DOM
❌
Confinement: safe, too restricting
- Challenge: extensions need to “leak” data
- Solution: declassification via sharing menu API
❌
NYTimesConfinement: safe, too restricting
- Challenge: extensions need to “leak” data
- Solution: declassification via sharing menu API
❌
NYTimesConfinement: safe, too restricting
- Challenge: extensions need to “leak” data
- Solution: declassification via sharing menu API
❌
NYTimesConfinement: safe, too restricting
- Challenge: extensions need to “leak” data
- Solution: declassification via sharing menu API
❌
NYTimesConfinement: safe, too restricting
- Challenge: extensions need to “leak” data
- Solution: declassification via sharing menu API
❌
NYTimes EvernoteConfinement: safe, too restricting
- Challenge: extensions need to “leak” data
- Solution: declassification via sharing menu API
❌
NYTimes Evernote evernote.comUsable confinement via APIs
- Crypto API
- Declarative CSS API
- Network filtering API
- …
How can permissions be more meaningful?
- Many extensions can
be safe by default
➤ Confinement protectsuser privacy
➤ Incentivize developers by making warnings rare- To capture remaining models: need permissions
messages: what data is being “leaked”?
- E.g., URLS, page location, whole page, etc.
How can permissions be more meaningful?
- Many extensions can
be safe by default
➤ Confinement protectsuser privacy
➤ Incentivize developers by making warnings rare- To capture remaining models: need permissions
messages: what data is being “leaked”?
- E.g., URLS, page location, whole page, etc.
Summary
- Extensions: most dangerous code in the browser
- Rethink extension security systems
- One direction: confinement + new APIs
, makes permission requests rare