firefox security
play

Firefox Security Sid Stamm <sid@mozilla.com> Browser as a - PowerPoint PPT Presentation

Firefox Security Sid Stamm <sid@mozilla.com> Browser as a Protector Protect Site Content Safe Platform Third-Party Features Keeping your Secrets Content Restrictions Content Security Policy Content Restrictions Document


  1. Firefox Security Sid Stamm <sid@mozilla.com>

  2. Browser as a Protector • Protect Site Content • Safe Platform • Third-Party Features • Keeping your Secrets

  3. Content Restrictions Content Security Policy

  4. Content Restrictions Document “Good” behavior... Suppress the “Bad”

  5. Grabbing the Reins Content Restrictions • Content Rules & Regulations • Specify a “Normal Behavior” Policy • Catch and Block Violations <HTML> Content Policy Specify Rules Enforce Rules

  6. Step 1: Smooth Edges Content Restrictions • Scripts served in files (not inline) - “javascript:” URIs - <tag on*=...> event registration - text nodes in <script> tags • Establish Code / Data Separation - eval(“foo”) and friends

  7. Step 2: Restrictions on Content Content Restrictions • Block requests for all resources ... unless explicitly allowed by a policy!

  8. CSP: Policies Content Restrictions • HTTP Response Header X-CONTENT-SECURITY -POLICY • Directives to enforce listed within

  9. Speed Bump Content Restrictions <meta http-equiv=....>? • Designers may not have access to HTTP • T wo entities want restrictions • Multiple policies?

  10. Speed Bump Content Restrictions Intersecting Policies Given Policies P1 and P2: Pe = {u | P1 allows u AND P2 allows u}

  11. Speed Bump Content Restrictions <meta http-equiv=....>? • policy in-band is too dangerous • Multiple header instances!

  12. CSP: Directives Content Restrictions report-uri source directives policy-uri options

  13. CSP: Source Directives Content Restrictions allow (default for these) img-src font-src media-src xhr-src script-src frame-ancestors object-src style-src frame-src

  14. Speed Bump Content Restrictions ‘self’ ... in pieces? https://‘self’:443 ‘self’://foo.com foo.com:‘self’

  15. ‘self’ Content Restrictions ‘self‘ -> http://foo.com:80 bar.com:8080 -> http://bar.com:8080 http://foo.com -> http://foo.com:80 bar.com -> http://bar.com:80

  16. Speed Bump Content Restrictions Redirects http://foo.com http://bar.com http://duh.com

  17. Step 3: Profit • Sites only request explicitly allowed Content Restrictions resources • Injected inline scripts don’t run • Content homogenization (mixed content control) • Cross-domain CSRF reduction • Violation reports = early alert

  18. CSP: Use Case 1 Content Restrictions allow ‘self’ • Site wants all content to come from the same source (scheme, host, port)

  19. CSP: Use Case 2 Content Restrictions allow ‘self’; frame-src ads.net • Site wants all content to come from the same source (scheme, host, port), except content in iframes may be served by a third-party advertising network.

  20. CSP: Use Case 3 Content Restrictions allow ‘self’; img-src *; object-src *.teevee.com; script-src myscripts.com • Auction site wants to allow images from anywhere, plugin content from a trusted media provider network, and scripts only from its server hosting sanitized JavaScript

  21. CSP: Use Case 4 Content Restrictions allow https://*.x.com; • Example site wants to force all content to be served via HTTPS on port 443, from any subdomain of example.com

  22. Wait! That breaks my site! Content Restrictions • Good Option: convert your site • Less Good Option: disable parts of CSP

  23. Ramping Up Content Restrictions • Disable some restrictions via options • Report-Only mode • “Writing a Policy” guide • “Converting your Site” guide • Maybe a policy recommendation tool?

  24. Safe Platform Safe Platform

  25. Wrappers • XPCNativeWrapper Safe Platform

  26. Wrappers • ChromeObjectWrapper Safe Platform

  27. Wrappers • SafeJSObjectWrapper Safe Platform JS

  28. Wrappers • CrossOriginWrapper Safe Platform

  29. Safe Platform Safe Platform Out of Process Plug-Ins

  30. Third-Party Features Add-Ons

  31. Third-Party Features XPCOM and IDL

  32. XPCOM and IDL Third-Party Features Source: http://www.ibm.com/developerworks/java/library/os-xpcomfirefox/

  33. Third-Party Features Untamed Add-Ons

  34. Third-Party Features Jetpack

  35. Jetpack Third-Party Features API module module Jetpack My module Backend Add-On module (XPCOM) module module

  36. Jetpack Third-Party Features API module module Jetpack My module Backend Add-On module (XPCOM) module module JavaScript

  37. Jetpack Third-Party Features API module module Jetpack My Capabilities : module 1. http://foo.com Backend Add-On module 2. graphics (XPCOM) 3. menus module module

  38. Keeping your Secrets Features and Your Privacy

  39. Keeping your Secrets History Sniffing https://wiki.mozilla.org/User:Sidstamm/CSS_History_Sniffing_Links http://dbaron.org/mozilla/visited-privacy

  40. Keeping your Secrets Private Browsing (roll-back time)

  41. Keeping your Secrets NPAPI Hooks Private Browsing, Clear Recent History, etc

  42. Keeping your Secrets Browser Traces

  43. Browser as a Protector • Protect Site Content • Safe Platform • Third-Party Features • Keeping your Secrets

Recommend


More recommend