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 full-size slide

  2. Firefox
    Security & Privacy

    View full-size slide

  3. overview of what we work on

    View full-size slide

  4. overview of what we work on
    interrupt me!

    View full-size slide

  5. security
    privacy
    &

    View full-size slide

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

    View full-size slide

  7. security
    for users

    View full-size slide

  8. Safe Browsing

    View full-size slide

  9. pre-downloaded URL hash prefixes

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. 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 full-size slide

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

    View full-size slide

  15. Application Reputation

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  18. 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 full-size slide

  19. 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 full-size slide

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

    View full-size slide

  21. security
    for developers

    View full-size slide

  22. Content Security Policy
    aka CSP
    mechanism for preventing XSS

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  26. Hi you!
    John Doe - just moments ago

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  31. GET bank.ca 301

    GET https://bank.ca 200

    no HSTS, no sslstrip

    View full-size slide

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

    View full-size slide

  33. what does HSTS look like?

    View full-size slide

  34. $ 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 full-size slide

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

    View full-size slide

  36. no HTTP traffic for
    sslstrip to tamper with

    View full-size slide

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

    View full-size slide

  38. what would happen if that
    server were compromised?

    View full-size slide

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

    View full-size slide

  40. simple solution

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  44. security
    for sysadmins

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  48. “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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  55. SHA-1
    1024-bit certificates
    RC4

    View full-size slide

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

    View full-size slide

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


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






    View full-size slide

  58. turn on full mixed-content blocking in development

    View full-size slide

  59. privacy
    for users

    View full-size slide

  60. Tracking Protection

    View full-size slide

  61. Tracking Protection
    in Private Browsing mode

    View full-size slide

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

    View full-size slide

  63. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  67. about:config
    privacy.trackingprotection.enabled

    View full-size slide

  68. privacy
    for developers

    View full-size slide

  69. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  75. Content-Security-Policy: referrer origin;


    View full-size slide

  76. Content-Security-Policy: referrer origin;


    View full-size slide

  77. Content-Security-Policy: referrer origin;


    View full-size slide

  78. recommendations
    for users

    View full-size slide

  79. 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 full-size slide

  80. recommendations
    for developers

    View full-size slide

  81. 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 full-size slide

  82. recommendations
    for sysadmins

    View full-size slide

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

    View full-size slide

  84. 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 full-size slide

  85. 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 full-size slide