security signature inference for javascript based browser
play

Security Signature Inference for JavaScript-based Browser Addons - PowerPoint PPT Presentation

Security Signature Inference for JavaScript-based Browser Addons Vineeth Kashyap , Ben Hardekopf University of California Santa Barbara CGO 2014 1 JavaScript-based Browser Addons 2 Addons: JavaScript with High Privileges 3


  1. Security Signature Inference for JavaScript-based Browser Addons Vineeth Kashyap , Ben Hardekopf University of California Santa Barbara � CGO 2014 � 1

  2. JavaScript-based Browser Addons � 2

  3. Addons: JavaScript with High Privileges � 3

  4. Urging Security Concern • Proof of concept exploits • FFSni ff , a configurable password stealer • Unintentional vulnerabilities • Wikipedia Toolbar allowed arbitrary privileged code execution • Intentionally malicious • Key loggers � 4

  5. Curated Repositories � 5

  6. � 6

  7. � 7

  8. � 8

  9. � 9

  10. � 10

  11. Manual JavaScript Addon Vetting is Difficult • Ad-hoc • Tedious • Error-prone � 11

  12. Our Goal: Help Automate the Vetting Process • Automatically infer security signatures • Summarize interesting information flows and critical API usages � 12

  13. Our Goal: Help Automate the Vetting Process • Automatically infer security signatures • Summarize interesting information flows and critical API usages � 12

  14. Our Goal: Help Automate the Vetting Process • Automatically infer security signatures • Summarize interesting information flows and critical API usages � 12

  15. Our Goal: Help Automate the Vetting Process • Automatically infer security signatures • Summarize interesting information flows and critical API usages amplified local control flow url send (www.evil.com) � 12

  16. Key Challenges • Flexible security policies • No single policy applies for all addons • Classifying Information Flows • Binary result (secure or insecure) is not enough • Inferring Network Domains • Critical to reason about addon’s network communication � 13

  17. Our Solution • Construct annotated Program Dependence Graphs (PDG) • Use annotated PDGs to generate security signatures • Use prefix string analysis to infer network domains communicated with � 14

  18. Our Solution • Construct annotated Program Dependence Graphs (PDG) • Use annotated PDGs to generate security signatures • Use prefix string analysis to infer network domains communicated with � 14

  19. Our Solution • Construct annotated Program Dependence Graphs (PDG) • Use annotated PDGs to generate security signatures • Use prefix string analysis to infer network domains communicated with � 14

  20. Our Solution • Construct annotated Program Dependence Graphs (PDG) • Use annotated PDGs to generate security signatures • Use prefix string analysis to infer network domains communicated with Automatically summarize API usages, interesting information flows (classified based on the type of flow) � 14

  21. Annotated Program Dependence Graph • Use JSAI † to construct a PDG • Annotate the edges of PDG with the type of dependency † JSAI is a sound and e ffj cient JavaScript abstract interpreter we developed. � 15

  22. Strong vs. Weak Data Dependency 1 var data = {loc: url, other: 1} 2 send(data[“loc”]); 3 send(data[getString()]); � 16

  23. Strong vs. Weak Data Dependency 1 var data = {loc: url, other: 1} 2 send(data[“loc”]); 3 send(data[getString()]); � 16

  24. Strong vs. Weak Data Dependency 1 var data = {loc: url, other: 1} 2 send(data[“loc”]); 3 send(data[getString()]); � 16

  25. Local Control Dependency 5 if (url == "secret.com") 6 send(null); � 17

  26. Local Control Dependency 5 if (url == "secret.com") 6 send(null); � 17

  27. Syntax-obvious Non-local Control Dependency 13 try { 14 if (url != "hush-hush.com") 15 throw "irrelevant"; 16 send(null); 17 } catch(x) {}; 14 � 18

  28. Syntax-obvious Non-local Control Dependency 13 try { 14 if (url != "hush-hush.com") 15 throw "irrelevant"; 16 send(null); 17 } catch(x) {}; 14 � 18

  29. Non-obvious Non-local Control Dependency 18 try { 19 if (url != "mystic.com") 20 obj.prop = 1; 21 send(null); 22 } catch(x) {} � 19

  30. Non-obvious Non-local Control Dependency 18 try { 19 if (url != "mystic.com") 20 obj.prop = 1; 21 send(null); 22 } catch(x) {} � 19

  31. Amplified vs. Simple Control Dependencies 7 var arr = ["covert.com", "priv.com"/*,..*/]; 8 var i=0, count=0; 9 while (arr[i] && url != arr[i]) { 10 i++; 11 count++; } // end while 12 send(count); � 20

  32. Amplified vs. Simple Control Dependencies 7 var arr = ["covert.com", "priv.com"/*,..*/]; 8 var i=0, count=0; 9 while (arr[i] && url != arr[i]) { 10 i++; 11 count++; } // end while 12 send(count); � 20

  33. Lattice of Perceived Flow Strength Stronger � Flow � 21

  34. Lattice of Perceived Flow Strength data Stronger � Flow control � 22

  35. Lattice of Perceived Flow Strength Stronger � Flow amplified not amplified � 23

  36. Lattice of Perceived Flow Strength Stronger � local Flow non local � 24

  37. Lattice of Perceived Flow Strength Stronger � Flow syntax obvious non obvious � 25

  38. Generating Security Signatures • Use the PDG to reason about information flow in addons • Use PDG annotations to classify flows • Output a signature summarizing relevant flows � 26

  39. Generating Security Signatures • Use the PDG to reason about information flow in addons • Use PDG annotations to classify flows • Output a signature summarizing relevant flows amplified local control flow url send (www.evil.com) � 26

  40. Generating Security Signatures � 27

  41. Generating Security Signatures � 27

  42. Generating Security Signatures � 27

  43. Generating Security Signatures � 28

  44. Generating Security Signatures � 29

  45. Generating Security Signatures � 29

  46. Generating Security Signatures � 30

  47. Generating Security Signatures � 31

  48. Generating Security Signatures � 32

  49. Generating Security Signatures � 33

  50. Generating Security Signatures � 33

  51. Generating Security Signatures amplified local control flow url send (www.evil.com) � 33

  52. Evaluation • Evaluated analysis on 10 real addons from Mozilla repository • Manually created security signatures based on submitted addon description • Ran the analysis to get inferred signature, compared against our manual signature • Possible experimental outcomes: • pass (no unexpected information flow) • fail (false unexpected information flow) • leak (true unexpected information flow) � 34

  53. Results † † † In all these cases, the failure was due to insu ffi cient precision in the string domain. � 35

  54. Conclusion • Browser addon vetting is hard, needs automation • Security signatures are useful to understand security behavior of addons Implementation available under the Downloads link at � http://www.cs.ucsb.edu/~pllab � 36

  55. Acknowledgements • Tommy Ashmore and Ben Wiedermann (Harvey Mudd College) • Dave Herman (Mozilla Research) • Mozilla Addon Vetting Team � 37

  56. Questions? vineeth@cs.ucsb.edu � 38

Recommend


More recommend