Download - Are we security yet
![Page 1: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/1.jpg)
ARE WE SECURITY YET?Cristian Vat, @deathy
Geek.
Security Enthusiast
![Page 2: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/2.jpg)
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
![Page 3: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/3.jpg)
Content Injection
https://dannyman.toldme.com/2010/12/23/swa-yahoo-being-evil/
![Page 4: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/4.jpg)
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
![Page 5: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/5.jpg)
HTTPS Vulnerabilities
• Renegociation attack
• DROWN
• CRIME
• BEAST
• POODLE
• RC4
• Heartbleed
• FREAK
• LOGJAM
![Page 6: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/6.jpg)
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;
![Page 7: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/7.jpg)
Solution: Configuration Generator
• https://mozilla.github.io/server-side-tls/ssl-config-generator/
![Page 8: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/8.jpg)
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.
![Page 9: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/9.jpg)
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>
![Page 10: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/10.jpg)
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?
![Page 11: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/11.jpg)
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
![Page 12: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/12.jpg)
Problem: First request fresh browser
• Fresh browser install
• Never visited a certain website before
• Nothing in HSTS cache
![Page 13: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/13.jpg)
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 )
![Page 14: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/14.jpg)
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.
![Page 15: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/15.jpg)
The CA Problem
• CA “Mafia”
• Making money from nothing
• HTTPS certificate cost may be prohibitive for personal websites
![Page 16: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/16.jpg)
Solution: Let’s Encrypt
• Free domain validated certificates
• Fast, automatic
• Same security as anything else
• No wildcard/EV
• Short expiration date
![Page 17: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/17.jpg)
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
![Page 18: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/18.jpg)
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
![Page 19: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/19.jpg)
Problem: Library/Framework CSS/JS
• The Website is Slow
• Static Resource Serving is slow
• I don’t want to manage/package library JS/CSS
![Page 20: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/20.jpg)
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
![Page 21: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/21.jpg)
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>
![Page 22: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/22.jpg)
Resources
• https://www.ssllabs.com/ssltest/
• https://securityheaders.io/
• https://www.hardenize.com/
![Page 23: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/23.jpg)
![Page 24: Are we security yet](https://reader031.vdocument.in/reader031/viewer/2022030312/58ed95a71a28abcf2c8b45a1/html5/thumbnails/24.jpg)
SO... ARE WE SECURITY YET?