VEX: VETTING BROWSER EXTENSIONS FOR SECURITY VULNERABILITIES
XIANG PAN
ROADMAP1. Background2. Threat Model3. Static Information Flow Analysis4. Evaluation5. Related Works
EXTENSIONSExtensions Vs. Plugins1. Plugins are complicated, loadable modules. Flash and
Java are two examples2. Extensions are written mostly in JavaScript. They act as
part of the browser and they have wider access privileges than JS-in-a-webpage
150 million extensions are in use
EXTENSIONS ARCHITECTURE IN FIREFOX
EXTENSIONS ARE NOT SECURE1. Developers:
1. Many developers write extensions because of hobbies2. Likely to write vulnerable extensions 3. Don’t have time or interests to update their extensions
2. Reviewers:1. Not possible to understand all the extensions2. Don’t need to have great knowledge about extensions or
security3. Follow guidelines for what is not acceptable:
1. The guidelines focus on finding malicious extensions2. Vulnerable extensions can quiet easily slip through.
EXAMPLESReal Extension Vulnerabilities
by Roberto Suggi Liverani and Nick Freeman
http://www.securitytube.net/video/3492
SKYPE(<=3.8.0.188)ISSUE:
Automatic arbitory
Mozilla has a team of volunteers who help vet extensions manually.
Trusted add-on can’t always be trusted
Vietnamese Language Pack
VET EXTENSION
THREAT MODELGOAL:
finding security vulnerabilities in browser extensionsASSUMPTIONS:
1. Developers are not malicious2. Extensions are not obfuscated
POINTS OF ATTACK1. eval function2. InnerHTML3. EvalInSandBox4. wrappedJSObject
STATIC INFORMATION FLOW ANALYSIS1. Basic Goals
Source
Sink
Find Suspicious FlowPattern
SUSPICIOUS FLOW PATTERN1. Resource Description Framework (RDF) data to InnerHTML2. Content document data to eval3. Content document data to innerHTML4. evalInSandbox return objects used improperly by code
running with chrome privileges5. wrappedJSObject return object used improperly by code
running with vulnerabilities
The five flows don’t always result in a vulnerability and they are not an exhaustive list of all possible extension security bugs.
STATIC INFORMATION FLOW ANALYSIS1. Static Vs. Dynamic
1. Static: efficient and Complete2. Dynamic: accurate
2. Context Sensitive and Flow Sensitive
Abstract Heap is Required!
ANALYSIS DETAILS1. Variable Access
1. Check current scope (heap)2. Check global scope (heap)3. Create a new node and add it to global scope4. Ignore prototype5. Return with dependencies
ANALYSIS DETAILS2. Binary Operators
1. Return the union of dependencies of both expressions3. Object
1. Create heap locations for each of its properties2. Create a node for the object3. Link the object node to its property nodes
ANALYSIS DETAILS4. Function
1. Create heap location for each of its properties2. Create heap location for each of the arguments3. Create heap location for return value4. Create heap location for itself5. A function call executes all the argument parameters and
updates corresponding nodes6. If a function is not defined, the dependencies of the return
values are the union of dependencies of all the arguments
7. Does a function call execute the statements again?
ANALYSIS DETAILS5. Variable Declaration
1. If the variable doesn’t exist in current scope, create a new node.
2. Otherwise, replace the current one.6. Assignment
1. Evaluate left side expressions and right side expressions2. Replace the node on the left with the one on the right
ANALYSIS DETAILS7. Condition
Both IF and ELSE branches needs to be evaluated.
8. WhileWhile body needs to be evaluated till reaching a fixed point
ANALYSIS DETAILS9. EVAL
if the argument is constant string, the string will be inserted into the codes and analyzed as codes.
If the strings are not statically known, they are ignored.
VEX is unsound
ANALYSIS DETAILS10. Object properties accessed in the form of associative
arrays.In JavaScript, objects are treated as associative arrays
VEX doesn’t know which property is set. Whenever a property is created, its dependencies are added to the dependencies of the node.
EVALUATIONDownload a total of 2452 extensions, on an average, VEX took only 15.5 seconds per extension
SUCCESSFUL ATTACKSWikipedia, Toolbar, up to version 0.5.9
SUCCESSFUL ATTACKSFizzle versions 0.5, 0.5.1, 0.5.2
SUCCESSFUL ATTACKSBeatnik Version 1.2
FLOWS THAT DO NOT RESULT IN ATTACKS1. Source is trusted (what about XSS?)2. Sanitized input (Complete?)3. Non-chrome sinks (less privileges)
RELATED WORKS1. Plugin security2. Dynamic information flow analysis for browser
extensions3. Flow-insensitive static information flow methods for
JavaScript