Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Security and Privacy on the Web in 2015

Security and Privacy on the Web in 2015

In the last few years, a number of new security features have become available to web developers (e.g. Content Security Policy, Strict Transport Security) and a few more are coming up this year (e.g. Referrer Policy, Subresource Integrity).

As a browser vendor and a member of the W3C WebAppSec working group, Mozilla is busy extending the web platform to provide the tools and features that developers and users need in 2015. In addition to that, the non-profit behind Firefox is experimenting with new ways to protect its users, building on Google's Safe Browsing technology to defend users against tracking.

Francois Marier

September 21, 2015
Tweet

More Decks by Francois Marier

Other Decks in Programming

Transcript

  1. Security and Privacy
    on the Web in 2015
    François Marier @fmarier
    mozilla

    View Slide

  2. Firefox
    Security & Privacy

    View Slide

  3. overview of what we work on

    View Slide

  4. overview of what we work on
    interrupt me!

    View Slide

  5. security
    privacy
    &

    View Slide

  6. ???????????????
    ???????????????
    security
    privacy
    &

    View Slide

  7. security

    View Slide

  8. security
    for users

    View Slide

  9. Safe Browsing

    View Slide

  10. View Slide

  11. pre-downloaded URL hash prefixes

    View Slide

  12. pre-downloaded URL hash prefixes
    list updated every 30 minutes

    View Slide

  13. pre-downloaded URL hash prefixes
    list updated every 30 minutes
    server completions on prefix hit (with noise entries)

    View Slide

  14. pre-downloaded URL hash prefixes
    list updated every 30 minutes
    server completions on prefix hit (with noise entries)
    separate cookie jar

    View Slide

  15. pre-downloaded URL hash prefixes
    list updated every 30 minutes
    server completions on prefix hit (with noise entries)
    separate cookie jar
    list entries expire after 45 minutes

    View Slide

  16. about:config
    browser.safebrowsing.enabled (phishing)
    browser.safebrowsing.malware.enabled (malware)

    View Slide

  17. Application Reputation

    View Slide

  18. View Slide

  19. is it on the pre-downloaded list of dangerous hosts?

    View Slide

  20. is it on the pre-downloaded list of dangerous hosts?
    is it signed by a known good software provider?

    View Slide

  21. is it on the pre-downloaded list of dangerous hosts?
    is it signed by a known good software provider?
    is it an executable file (.exe, .com, .pif, .dmg, etc.)?

    View Slide

  22. is it on the pre-downloaded list of dangerous hosts?
    is it signed by a known good software provider?
    is it an executable file (.exe, .com, .pif, .dmg, etc.)?
    what does the apprep server think about it?

    View Slide

  23. about:config
    browser.safebrowsing.downloads.remote.enabled

    View Slide

  24. security
    for developers

    View Slide

  25. Content Security Policy
    aka CSP
    mechanism for preventing XSS

    View Slide

  26. telling the browser what external
    content is allowed to load

    View Slide

  27. Hi you<br/>alert('p0wned');<br/>!
    Tweet!
    What's on your mind?

    View Slide

  28. without CSP

    View Slide

  29. Hi you!
    John Doe - just moments ago
    p0wned
    Ok

    View Slide

  30. with CSP

    View Slide

  31. Hi you!
    John Doe - just moments ago

    View Slide

  32. Content-Security-Policy:
    script-src 'self'
    https://cdn.example.com

    View Slide

  33. script-src
    object-src
    style-src
    img-src
    media-src
    frame-src
    font-src
    connect-src

    View Slide

  34. Strict Transport Security
    aka HSTS
    mechanism for preventing
    HTTPS to HTTP downgrades

    View Slide

  35. telling the browser that your site
    should never be reached over HTTP

    View Slide

  36. View Slide

  37. GET bank.ca 301

    GET https://bank.ca 200

    no HSTS, no sslstrip

    View Slide

  38. GET bank.ca → 200
    no HSTS, with sslstrip

    View Slide

  39. what does HSTS look like?

    View Slide

  40. $ curl -i https://example.com
    HTTP/1.1 200 OK
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Strict-Transport-Security: max-age=31536000
    ...

    View Slide

  41. with HSTS, with sslstrip
    GET https://bank.ca 200

    View Slide

  42. no HTTP traffic for
    sslstrip to tamper with

    View Slide

  43. View Slide

  44. View Slide

  45. View Slide

  46. https://ajax.googleapis.com
    /ajax/libs/jquery/1.8.0/
    jquery.min.js

    View Slide

  47. what would happen if that
    server were compromised?

    View Slide

  48. View Slide

  49. Bad Things™
    steal sessions
    leak confidential data
    redirect to phishing sites
    enlist DDoS zombies

    View Slide

  50. simple solution

    View Slide

  51. instead of this:
    src=”https://ajax.googleapis.com...”>

    View Slide

  52. src=”https://ajax.googleapis.com...”
    integrity=”sha256-1z4uG/+cVbhShP...”
    crossorigin=”anonymous”>
    do this:

    View Slide

  53. guarantee:
    script won't change
    or it'll be blocked

    View Slide

  54. security
    for sysadmins

    View Slide

  55. HTTPS

    View Slide

  56. if you're not using it, now is the time to start :)

    View Slide

  57. View Slide

  58. View Slide

  59. mass surveillance of
    all Internet traffic
    is no longer theoretical

    View Slide

  60. strong encryption of
    all Internet traffic
    is no longer optional

    View Slide

  61. “If we only use encryption when we're working with
    important data, then encryption signals that data's
    importance. If only dissidents use encryption in a
    country, that country's authorities have an easy way of
    identifying them. But if everyone uses it all of the time,
    encryption ceases to be a signal. The government can't
    tell the dissidents from the rest of the population. Every
    time you use encryption, you're protecting someone
    who needs to use it to stay alive.”
    -Bruce Schneier

    View Slide

  62. ps://gigaom.com/2015/02/19/dont-let-att-mislead-you-about-its-29-privacy-fee/

    View Slide

  63. View Slide

  64. $ apt-get install letsencrypt
    $ letsencrypt example.com

    View Slide

  65. automatically prove domain ownership
    download a free-as-in-beer certificate
    monitor and renew it before it expires

    View Slide

  66. automatically prove domain ownership
    download a free-as-in-beer certificate
    monitor and renew it before it expires

    View Slide

  67. automatically prove domain ownership
    download a free-as-in-beer certificate
    monitor and renew it before it expires

    View Slide

  68. HTTPS is not enough
    you need to do it properly

    View Slide

  69. RC4

    View Slide

  70. SHA-1
    RC4

    View Slide

  71. SHA-1
    1024-bit certificates
    RC4

    View Slide

  72. SHA-1
    1024-bit certificates
    RC4 weak DH parameters

    View Slide

  73. View Slide

  74. View Slide

  75. View Slide

  76. View Slide

  77. https://people.mozilla.org/~fmarier/mixed-content.html


    src="http://people.mozilla.org/~fmarier/mixed-content.js">






    View Slide

  78. View Slide

  79. turn on full mixed-content blocking in development

    View Slide

  80. privacy

    View Slide

  81. privacy
    for users

    View Slide

  82. View Slide

  83. View Slide

  84. View Slide

  85. Tracking Protection

    View Slide

  86. Tracking Protection
    in Private Browsing mode

    View Slide

  87. based on Safe Browsing
    pre-downloaded list of full hashes
    (no server lookups)

    View Slide

  88. is this resource coming from a third-party server?
    is it on Disconnect's list of trackers?
    is it actually a third-party or
    does it belong to the same org?

    View Slide

  89. Q: What does it do?
    A: It blocks network loads!

    View Slide

  90. No cookies
    No fingerprinting
    No wasted bandwidth
    No performance hit

    View Slide

  91. about:config
    privacy.trackingprotection.pbmode.enabled

    View Slide

  92. about:config
    privacy.trackingprotection.enabled

    View Slide

  93. privacy
    for developers

    View Slide

  94. View Slide

  95. View Slide

  96. http://example.com/search?q=serious+medical+condition
    Click here for
    the cheapest
    insurance
    around!
    Bla bla bla, bla bla, bla bla bla bla. Bla bla bla, bla
    bla, bla bla bla bla. Bla bla bla, bla bla, bla bla bla bla.
    Bla bla bla, bla bla, bla bla bla bla. Bla bla bla, bla
    bla, bla bla bla bla. Bla bla bla, bla bla, bla bla bla bla.
    Bla bla bla, bla bla, bla bla bla bla. Bla bla bla, bla
    bla, bla bla bla bla. Bla bla bla, bla bla, bla bla bla bla.
    Bla bla bla, bla bla, bla bla bla bla.

    View Slide

  97. View Slide

  98. No Referrer
    No Referrer When Downgrade
    Origin Only
    Origin When Cross Origin
    Unsafe URL

    View Slide

  99. No Referrer
    No Referrer When Downgrade
    Origin Only
    Origin When Cross Origin
    Unsafe URL

    View Slide

  100. No Referrer
    No Referrer When Downgrade
    Origin Only
    Origin When Cross Origin
    Unsafe URL

    View Slide

  101. No Referrer
    No Referrer When Downgrade
    Origin Only
    Origin When Cross Origin
    Unsafe URL

    View Slide

  102. No Referrer
    No Referrer When Downgrade
    Origin Only
    Origin When Cross Origin
    Unsafe URL

    View Slide

  103. Content-Security-Policy: referrer origin;


    View Slide

  104. Content-Security-Policy: referrer origin;


    View Slide

  105. Content-Security-Policy: referrer origin;


    View Slide

  106. recommendations
    for users

    View Slide

  107. Use the non-corporate browser primarily
    network.cookie.cookieBehavior = 3
    network.http.referer.spoofSource = true
    privacy.trackingprotection.enabled = true
    Install the EFF's HTTPS Everywhere add-on

    View Slide

  108. recommendations
    for developers

    View Slide

  109. Use SRI for your external scripts
    Set a more restrictive Referrer policy
    Consider enabling CSP
    Watch out for mixed content
    Test your site with Tracking Protection

    View Slide

  110. recommendations
    for sysadmins

    View Slide

  111. Enable HTTPS and HSTS on all your sites
    Use our recommended TLS config
    Test your site periodically using SSL Labs

    View Slide

  112. Questions?
    feedback:
    [email protected]
    mozilla.dev.security
    [email protected]
    © 2015 François Marier
    This work is licensed under a
    Creative Commons Attribution-ShareAlike 4.0 License.

    View Slide

  113. photo credits:
    tinfoil: https://www.flickr.com/photos/laurelrusswurm/15129449047
    explosion: https://www.flickr.com/photos/-cavin-/2313239884/
    snowden: https://www.flickr.com/photos/gageskidmore/16526354372

    View Slide