protecting users by confining javascript with swapi
play

Protecting Users by Confining JavaScript with SWAPI Deian Stefan, - PowerPoint PPT Presentation

Protecting Users by Confining JavaScript with SWAPI Deian Stefan, Petr Marchenko, Brad Karp, David Mazires, Dave Herman, and John C. Mitchell Modern websites are complex Modern websites are complex Modern websites are complex Page code


  1. Protecting Users by Confining JavaScript with SWAPI Deian Stefan, Petr Marchenko, Brad Karp, David Mazières, Dave Herman, and John C. Mitchell

  2. Modern websites are complex

  3. Modern websites are complex

  4. Modern websites are complex Page code

  5. Modern websites are complex Ad code Page code

  6. Modern websites are complex Ad code Page code Third-party APIs

  7. Modern websites are complex Ad code Page code Third-party libraries Third-party APIs

  8. Modern websites are complex Ad code Extensions Page code Third-party libraries Third-party APIs

  9. Modern websites handle sensitive information • Financial data ➤ Online banking, tax filing, shopping, budgeting, … • Health data ➤ Genomics, prescriptions, … • Personal data ➤ Email, messaging, affiliations, …

  10. Many parties are interested in the sensitive data • Financial data ➤ Black-hat hackers, … • Health data ➤ Insurance companies, … • Personal data ➤ Ad companies, big governments, …

  11. Many parties are interested in the sensitive data • Financial data ➤ Black-hat hackers, … • Health data ➤ Insurance companies, … • Personal data ➤ Ad companies, big governments, …

  12. Many parties are interested in the sensitive data • Financial data ➤ Black-hat hackers, … • Health data ➤ Insurance companies, … • Personal data ➤ Ad companies, big governments, …

  13. Many parties are interested in the sensitive data • Financial data ➤ Black-hat hackers, … • Health data ➤ Insurance companies, … • Personal data ➤ Ad companies, big governments, …

  14. How do we protect sensitive data? Non requirements � … information exchange is still more important than secrecy. Tim Berners-Lee, 1989

  15. How do we protect sensitive data? Non requirements � … information exchange is still more important than secrecy. Tim Berners-Lee, 1989 still somewhat true…

  16. How do we protect sensitive data? Non requirements � … information exchange is still more important than secrecy. Tim Berners-Lee, 1989 still somewhat true… but this was before the Web became the platform…

  17. 
 
 What is the state of the art in web security? • Same Origin Policy • Content Security Policy • Sandboxing 


  18. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 a.com b.com c.com

  19. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 a.com b.com c.com

  20. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 a.com b.com c.com

  21. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 postMessage a.com b.com c.com

  22. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 postMessage ✓ a.com b.com c.com

  23. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 postMessage ✓ a.com b.com c.com JSON

  24. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 postMessage ✓ JSON a.com b.com c.com

  25. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 postMessage ✓ JSON a.com b.com c.com

  26. 
 
 
 
 
 Same Origin Policy Idea: isolate content from different origins ➤ E.g., can’t access document of cross-origin page ➤ E.g., can’t inspect responses from cross-origin 
 postMessage ✓ JSON a.com b.com c.com

  27. Same Origin Policy Limitations: ➤ Some DOM objects leak data E.g., image size can leak if user is logged in - ➤ Data exfiltration is trivial E.g., any XHR request can contain data form page - ➤ Cross-origin scripts run with privilege of page ➠ Injected scripts can corrupt and leak user data!

  28. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 a.com c.com

  29. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 a.com b.com c.com

  30. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 ✓ a.com b.com c.com

  31. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 ✓ a.com b.com c.com JSON

  32. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 ✓ a.com b.com c.com JSON

  33. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 ✓ a.com b.com c.com JSON

  34. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 ✓ a.com b.com c.com JSON

  35. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 ✓ a.com b.com c.com JSON

  36. 
 
 
 
 
 Content Security Policy Goal: prevent and limit damage of XSS attacks 
 Idea: restrict resource loading to a white-list ➤ E.g., default-src ‘self’ http://b.com; img-src * 
 ✓ a.com b.com c.com JSON

  37. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 a.com a.com

  38. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 a.com a.com

  39. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin unq0 ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 a.com a.com

  40. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin unq0 ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 a.com a.com

  41. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin ✓ unq0 ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 a.com a.com

  42. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin ✓ unq0 ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 a.com a.com

  43. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin ✓ unq0 ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 unq1 a.com a.com

  44. Sandboxing Idea: restrict actions page can perform ➤ E.g., directive sandbox allow-scripts 
 ensures iframe has 
 unique origin ✓ unq0 ➤ E.g., directive sandbox 
 a.com a.com ensures iframe has 
 unique origin and cannot 
 execute JavaScript 
 unq1 a.com a.com

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend