are we security yet
TRANSCRIPT
ARE WE SECURITY YET?Cristian Vat, @deathy
Geek.
Security Enthusiast
Problem: HTTP is not encrypted
• Traffic can be passively intercepted• Including your cookies/sessions, personal information
• Can be targeted for ads or more malicious reasons
• Traffic can be manipulated• Ad injection
• Malware injection
Content Injection
https://dannyman.toldme.com/2010/12/23/swa-yahoo-being-evil/
Solution: HTTPS
• Or is it SSL? Or TLS? Which version again?
• SSL 1.0 – not released, serious flaws
• SSL 2.0 – February 1995, multiple flaws
• SSL 3.0 – 1996
• great start…
• 1999 – TLS 1.0
• 2006 – TLS 1.1
• 2008 – TLS 1.2
• 2016-2017 – TLS 1.3, some early adopters already
HTTPS Vulnerabilities
• Renegociation attack
• DROWN
• CRIME
• BEAST
• POODLE
• RC4
• Heartbleed
• FREAK
• LOGJAM
Configuration complexityssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-
SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-
RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-
SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-
SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-
SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-
SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-
SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-
SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;
Solution: Configuration Generator
• https://mozilla.github.io/server-side-tls/ssl-config-generator/
Problem: HTTP links/requests
• Browsers still default to HTTP on port 80, which is OK
• Some clients may not support HTTPS
• Bookmarks
• It’s a web of links. Old links and you can’t update them all.
Solution: Redirect to HTTPS!
• HTTP Redirect: • Client: GET http://somesite.ro/
• Server: 301 Redirect to https://somesite.ro/
• JavaScript … $ curl -i http://www.homebank.ro/
HTTP/1.1 200 OK
content-length: 148
content-type: text/html
date: Fri, 17 Feb 2017 12:51:43 GMT
last-modified: Fri, 25 Oct 2013 22:58:06 GMT
p3p: CP="NON CUR OTPi OUR NOR UNI"
<script>
//redirect to public junction for login!
document.location="https://www.homebank.ro/public/HomeBankLogin/jsp/index.jsp";
</script>
Problem: Many slow redirects
• You’re still possibly redirecting every individual link
• Caching of redirects: • “It depends”
• Possible cause of bugs even if you just want to switch “http:” to “https:”
• No clear browser knowledge that page should only be used on HTTPS.
• Solution?
Solution: HSTS saves the day!
• HTTP Strict Transport Security• On valid HTTPS request the server sends a new HTTP Header:
• Browser will redirect all HTTP requests to HTTPS internally until expiry
• Even if user manually types an “http://” link!
Strict-Transport-Security: max-age=<expire-time>; includeSubDomains
Problem: First request fresh browser
• Fresh browser install
• Never visited a certain website before
• Nothing in HSTS cache
Solution: HSTS Preload
• Need a valid HSTS setup
• Go to https://hstspreload.org/ and submit your site to preload list
• Chrome preload list: https://chromium.googlesource.com/chromium/src/net/+/refs/heads/master/http/transport_security_state_static.json
• Gets baked in to Chrome, Firefox, Internet Explorer downloads/updates.
• Currently holds 80 “.ro” domains. (2 of them mine, banks seen: only brd.ro and unicredit.ro )
Problem: Security by Coincidence
• Just a very small sample. flanco.ro:
Our dev team who manages the our public website has mistakenly
configured the preload function + include_includesubdomains. This
feature has blocked our internal websites as well, even if the don’t > use
SSL at all. :(
hovie.at:
We cannot support HTTPS on the following subdomains:
• andrew.hovie.at - I don't have to time
to manage my own server anymore, so I switched to a hosting
provider, wildcard certs are expensive, they do not support certs
with multiple domains.
Also, when I enabled preload, I did not actually know what I am doing,
I was just following the recommendation from https://cipherli.st/.
chrishamper.com:
I had enabled the HSTS header with the "preload" directive on my domain
while
following an online guide related to HSTS, which didn't explain the
meaning or
repercussions of that directive. It is now causing much trouble when
attempting to do development work using subdomains I'm spinning up as
needed.
The CA Problem
• CA “Mafia”
• Making money from nothing
• HTTPS certificate cost may be prohibitive for personal websites
Solution: Let’s Encrypt
• Free domain validated certificates
• Fast, automatic
• Same security as anything else
• No wildcard/EV
• Short expiration date
The other CA problem
• Any CA can issue certs for any domain
• China CA can issue certificate for your US-based website
• Active attacks or bugs in CA validation
• See DigiNotar
Solution: HTTP Public Key Pinning
• Pin Public Keys of CAs which are allowed to issue certs for your site• Need at least 2 pins.
• You can break your site…
• Certificate Transparency
Problem: Library/Framework CSS/JS
• The Website is Slow
• Static Resource Serving is slow
• I don’t want to manage/package library JS/CSS
Solution: CDNs to the rescue!
• Load jQuery/Bootstrap/etc. from CDN
• Problem:• Now you depend on the CDN’s security
• Requests may be intercepted
• Active JS content running in your page may be modified by the CDN
Solution: Subresource Integrity
• Include the hash of a known good version in the <script> or <link> tag in your page
• Browser downloads resource but checks hash before applying styles/script to page.
<script src="https://example.com/example-framework.js" integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"crossorigin="anonymous"></script>
Resources
• https://www.ssllabs.com/ssltest/
• https://securityheaders.io/
• https://www.hardenize.com/
SO... ARE WE SECURITY YET?