Serge Borso serge@sergeborso.com The Heartbleed Bug Serge Borso serge@sergeborso.com.

Slides:



Advertisements
Similar presentations
Chapter 17: WEB COMPONENTS
Advertisements

SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
Socket Layer Security. In this Presentation: need for web security SSL/TLS transport layer security protocols HTTPS secure shell (SSH)
An Introduction to Secure Sockets Layer (SSL). Overview Types of encryption SSL History Design Goals Protocol Problems Competing Technologies.
Topic 8: Secure communication in mobile devices. Choice of secure communication protocols, leveraging SSL for remote authentication and using HTTPS for.
CSE 461 Section. “Transport Layer Security” protocol Standard protocol for encrypting Internet traffic Previously known as SSL (Secure Sockets Layer),
TLS Renegotiation: Explanation & Exploitation Mikhail Davidov Leviathan Security Group.
SECURITY IN E-COMMERCE VARNA FREE UNIVERSITY Prof. Teodora Bakardjieva.
Session Hijacking Why web security depends on communications security and how TLS everywhere is the only solution. Scott Helme - 6th Aug scotthel.me.
More on SSL/TLS. Internet security: TLS TLS is one of the more prominent internet security protocols. TLS is one of the more prominent internet security.
Security Through Encryption. Different ways to achieve security of communication data Keep things under lock and key – Physical Encryption Through password.
Heartbleed Bug. When all the net security people are freaking out, it’s probably an okay time to worry.
CPS 290 Computer Security Heartbleed Bug Key Exchange RSA Analysis RSA Performance CPS 290Page 1.
© GlobalSign. A GMO Internet Inc group company. Authentication. Security. Trust. A tutorial on how you can host multiple SSL Certificates on a single IP.
Wi-Fi Security January 21, 2008 by Larry Finger. Wi-Fi Security Most laptops now come with built-in wireless capability, which can be very handy; however,
Mar 12, 2002Mårten Trolin1 This lecture Diffie-Hellman key agreement Authentication Certificates Certificate Authorities SSL/TLS.
Bringing Two-factor Authentication to Web Applications by Michael Starks 2005 March Rochester OWASP.
Web Security A how to guide on Keeping your Website Safe. By: Robert Black.
CMSC 414 Computer and Network Security Lecture 21 Jonathan Katz.
Encryption An Overview. Fundamental problems Internet traffic goes through many networks and routers Many of those networks are broadcast media Sniffing.
SSL By: Anthony Harris & Adam Shkoler. What is SSL? SSL stands for Secure Sockets Layer SSL is a cryptographic protocol which provides secure communications.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
The Heartbleed Bug A vulnerability in the OpenSSL Cryptographic Library.
How It Applies In A Virtual World
Security and Risk Management. Who Am I Matthew Strahan from Content Security Principal Security Consultant I look young, but I’ve been doing this for.
RFC6520 defines SSL Heartbeats - What are they? 1. SSL Heartbeats are used to keep a connection alive without the need to constantly renegotiate the SSL.
Port Knocking Software Project Presentation Paper Study – Part 1 Group member: Liew Jiun Hau ( ) Lee Shirly ( ) Ong Ivy ( )
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
Staying Safe Online Keep your Information Secure.
Web Browser Security Prepared By Mohammed EL-Batta Mohammed Soubih Supervised By Eng. Eman alajrami Explain Date 10. may University of Palestine.
Behzad Akbari Spring 2012 (These slides are based on lecture slides by Lawrie Brown)
Cosc 4765 SSL/TLS and VPN. SSL and TLS We can apply this generally, but also from a prospective of web services. Multi-layered: –S-http (secure http),
What is Heartbleed? Heartbleed is a vulnerability in OpenSSL software. OpenSSL is encryption software that accesses websites through a “secure” connection,
Protecting Internet Communications: Encryption  Encryption: Process of transforming plain text or data into cipher text that cannot be read by anyone.
Introduction to Secure Sockets Layer (SSL) Protocol Based on:
Security Protocols and E-commerce University of Palestine Eng. Wisam Zaqoot April 2010 ITSS 4201 Internet Insurance and Information Hiding.
Feedback #2 (under assignments) Lecture Code:
Kerberos Named after a mythological three-headed dog that guards the underworld of Hades, Kerberos is a network authentication protocol that was designed.
Zakir Durumeric, James Kasten,David Adrian, J. Alex Halderman, Michael Bailey, Frank Li, Nicholas Weaver, Johanna Amann, Jethro Beekman, Mathias Payer,
Lecture 11 Page 1 Advanced Network Security Cryptography and Networks: IPSec and SSL/TLS Advanced Network Security Peter Reiher August, 2014.
SEC835 Runtime authentication Secure session management Secure use of cryptomaterials.
Security. Security Flaws Errors that can be exploited by attackers Constantly exploited.
Presented by Teererai Marange. Background Open SSL Hearbeat extension Heartbleed vulnerability Description of work Methodology Summary of results Vulnerable.
CS 4244: Internet Programming Security 1.0. Introduction Client identification and cookies Basic Authentication Digest Authentication Secure HTTP.
Module 2 – User Safety Privacy Attacks on end users Browser vulnerabilities.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Convenience product security Collin Busch. What is a convenience product? A convenience product is a device or application that makes your life easier.
Your friend, Bluestem. What is Bluestem? “Bluestem is a software system which enables one or more high-security SSL HTTP servers in a domain (entrusted.
CNIT 124: Advanced Ethical Hacking Ch 10: Client-Side Exploitation.
Can SSL and TOR be intercepted? Secure Socket Layer.
Chapter 12: How Private are Web Interactions?. Why we care? How much of your personal info was released to the Internet each time you view a Web page?
SMUCSE 5349/7349 SSL/TLS. SMUCSE 5349/7349 Layers of Security.
Network and Internet Security Prepared by Dr. Lamiaa Elshenawy
Private key
SSL(HandShake) Protocol By J.STEPHY GRAFF IIM.SC(C.S)
SSH/SSL Attacks not on tests, just for fun. SSH/SSL Should Be Secure Cryptographic operations are secure SSL uses certificates to authenticate servers.
Mar 28, 2003Mårten Trolin1 This lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
COOKIES AND SESSIONS.
Lecture 6 (Chapter 16,17,18) Network and Internet Security Prepared by Dr. Lamiaa M. Elshenawy 1.
Lecture 10 Page 1 CS 236 Online SSL and TLS SSL – Secure Socket Layer TLS – Transport Layer Security The common standards for securing network applications.
SSL: Secure Socket Layer By: Mike Weissert. Overview Definition History & Background SSL Assurances SSL Session Problems Attacks & Defenses.
Common System Exploits Tom Chothia Computer Security, Lecture 17.
HEARTBLEED: Technical Description and Fixes
Introduction to Networking
How to Check if a site's connection is secure ?
Nessus Vulnerability Scanning
A Programmer’s Guide to Secure Connections
The Heartbleed Bug and Attack
Presentation transcript:

Serge Borso serge@sergeborso.com The Heartbleed Bug Serge Borso serge@sergeborso.com

On the docket Intro What is the Heartbleed bug? Why do we care? How does it work? Why does it matter? What is the impact? Q and A Closing

Introduction ~ Serge Borso Background: Jurassic park (1993) Had the pleasure to work on fun things like biometrics, online banking security, penetration testing… Sr. Security Engineer/ Lead Penetration Tester Mentor with the SANS institute Lots of experience with vulnerabilities Multiple letters behind name

What say you? Gauge audience – help me tailor the message ~Interaction~ Ask questions! Security professionals? Any developers? Managers? Impacted parties? Have FUN!!

What is the Heartbleed bug? A bug in OpenSSL’s heartbeat extension CVE-2014-0160 (Common vulnerabilities and exposures) – dictionary for public infosec vulns Called Heartbleed due to heartbeat extension The issue is with OpenSSL’s implementation of the heartbeat extension (not SSL in general) Discovered by Riku, Antti and Matti (Codenomicon) and Neel Mehta (Google) Published Monday April 7th

Interesting fact – 0day Public knowledge as of Monday 4-7-2014 But when was it really discovered?

Answer: Domain was created on Saturday 4-5-2014 http://heartbleed.com/ Domain Name: HEARTBLEED.COM Registrar WHOIS Server: whois.godaddy.com Registrar URL: http://www.godaddy.com Update Date: 2014-04-05 15:13:33 Creation Date: 2014-04-05 15:13:33 Domain was created on Saturday 4-5-2014 By “codenomicon” out of Oulu Finland “We fixed this vulnerability last week before it was made public” - CloudFlare on 4-7-2014

When did you hear about it? I heard about it Monday with the rest of the public I personally have two different “paid” advanced warning methods Still found out about it Monday 4-7-2014

How long has OpenSSL been vulnerable Since the 2012 March 14th release of version 1.0.1 OpenSSL 1.0.1 through 1.0.1f ARE vulnerable OpenSSL 1.0.1g NOT vulnerable OpenSSL 1.0.0 branch NOT vulnerable OpenSSL 0.9.8 branch NOT vulnerable

What is the Risk? Zero-day attacks occur during the vulnerability window that exists in the time between when vulnerability is first exploited and when software developers start to develop and publish a counter to that threat. – wikipedia Not a zero-day anymore as the patch has been released Still needs to be pushed out however on some platforms and applied

Note about zer0day(s) “This bug fix is a successful example of what is called responsible disclosure. Instead of disclosing the vulnerability to the public right away, the people notified of the problem tracked down the appropriate stakeholders and gave them a chance to fix the vulnerability before it went public.” - cloudflare

Risk part two: Allows anyone to trivially and secretly* extract: HTTPS banking information VPN traffic Passwords Authentication cookies Private keys And more 

Risk part three: Affects about 500,000, or 17.5 per cent, of “trusted” HTTPS websites *May be little risk depending on scenario* The risk is actually huge for some companies And this is why:

64k

What happens when exploited? 64k of memory gets dumped Per request I dumped 12GB overnight with a modest internet connection I wrote a script…

What gets dumped? Show me 

How serious is it?

Really? CloudFlare launched its own “heartbleed challenge” Not only did Heartbleed leak private session information (such as cookies and other data that SSL should have been protecting) But the crown jewels of an HTTPS web server were also vulnerable: the private SSL keys were accessible through Heartbleed messages

Their facial expressions say it all:

Why do we care? Because we are caring people! Remotely exploitable Easy to do (with a script) Significant implications/exposure Millions of targets are/were vulnerable Targets were exposure for over two years Essentially no logging for this Significant aftermath Sensitive data leaked…

Caring… For some of us, its our job Most of us interact with impacted sites Headache to reset passwords It’s a two-way street (client side exploit) End-users (us) are the victims since its our information that is at risk as much as the organization with the vulnerable webservice *Necessary to REVOKE and RE-ISSUE SSL certificates

Note – How can you easily tell? How do you know if your online banking website for example is/was vulnerable? IS it? https://www.ssllabs.com/ssltest/

Awesome tool – anyone can use

Was it vulnerable though? Ideally you would have been notified Check the issue date of the SSL certificate like the previous Google and Yahoo! examples

Note about Microsoft Windows Proprietary SSL/TLS implementation Does not use OpenSSL This means IIS sites are not impacted*

What is OpenSSL? It’s software/code Open-source implementation of the SSL and TLS protocols It’s a suite of tools (sweet tools, very useful) Written in C Implements basic cryptographic functions Started in 1998 The entire group consists of 11 members, of which 10 are volunteers

How does the exploit work? Missing bounds check before a memcpy() call that uses non-sanitized user input as the length parameter. An attacker can trick OpenSSL into allocating a 64KB buffer, copy more bytes than is necessary into the buffer, send that buffer back, and thus leak the contents of the victim's memory, 64KB at a time.

No really, how does it work? Time to fire up a virtual development environment and get our hands dirty VM is up and running, lets check the OpenSSL version: OpenSSL 1.0.1 through 1.0.1f ARE vulnerable

Webserver and SSL Quick install of nginx Never heard of it? Using OpenSSL to generate a 2048 bit RSA private key:

Here is the key:

Certificate Signing Request:

Generation of self-signed certificate

Install the Private key and certificate Using nginx as webserver Just a matter of copying the key and certificate Tell the webserver where to look for each and to use SSL (bind to port 443) Start the webserver next Default webpage comes up, verify the certificate:

Server is up – time to exploit Using nmap for quick demo No dice! Exploit did not work

Lets check openssl version again

That was fast The issue was already patched and my system was up to date But that’s no fun! Downgrade… Re-launch exploit Dump 64k of server memory

Memory dump

What is actually happening? Allocated memory is at risk Since the keys on the webserver are in memory they can be extracted Depends on where in memory they are Lets see what it looks like…

What is happening visual

Breakdown TCP three-way handshake (syn, syn-ack, ack) TLS client hello and negotiation with server Encrypted channel has been established Next comes the heartbeat Request Remember, the heartbeat’s intended use was to provide keep-alive functionality without renegotiation Basically keep the TLS session alive even when no information is being transmitted

Heartbeat Message request Machine A sends request data to Machine B Machine B sends response back to Machine A The attack works by sending a heartbeat request crafted such that the malicious request is only 1byte worth of data (for instance) but the message SAYS its 65536 bytes The vulnerable OpenSSL library fails to check the actual size, instead believing the stated size

The issue OpenSSL does not validate the message size Instead it blindly accepts the included value which is set by the attacker OpenSSL then references the memory location where the 1byte payload was stored Then dumps 65535 more bytes of memory in addition to the 1byte payload 65536 = 64k (1000 vs 1024) This is where the 64k of memory comes from

How to fix The fix is to protect against the way OpenSSL memory is allocated so that memory allocated for sensitive data (like private keys) is kept far away from the memory buffers used for messages Validate the user provided payload size Already fixed

Impacted sites + many more Facebook Instagram Yahoo! Google Pinterest Tumblr Amazon web services Godaddy Netflix…

What to do now? Reset passwords Update systems Revoke and re-issues SSL certificates The usual…

What does this mean? The little lock doesn’t mean “secure” Having unique passwords for *everything* is something I advocate Get a password safe to make that easy Three days ago there was another zero-day for Internet Explorer Life goes on This is what some of us get paid for.. Job security?

Conclusions Draw your own Did the NSA use this? I don’t get the impression that they knew about it beforehand How big of a deal was this? Depends on your circumstances Will something like this happen again Yes  Thanks for your time!

Q and Possibly A

References http://heartbleed.com/ http://blog.cloudflare.com/staying-ahead-of-openssl-vulnerabilities http://blog.cloudflare.com/searching-for-the-prime-suspect-how-heartbleed-leaked- private-keys http://blog.cloudflare.com/the-heartbleed-aftermath-all-cloudflare-certificates-revoked- and-reissued http://blog.existentialize.com/diagnosis-of-the-openssl-heartbleed-bug.html http://www.lightbluetouchpaper.org/2014/04/25/heartbleed-and-rsa-private-keys/ http://www.siemens.com/innovation/pool/de/forschungsfelder/siemens_security_adviso ry_ssa-635659.pdf https://isc.sans.edu/forums/diary/Testing+your+website+for+the+heartbleed+vulnerabil ity+with+nmap/17991 https://www.schneier.com/blog/archives/2014/04/heartbleed.html http://www.theregister.co.uk/2014/04/09/heartbleed_explained/ https://github.com/rapid7/metasploit- framework/blob/master/modules/auxiliary/scanner/ssl/openssl_heartbleed.rb https://blog.ipredator.se/2014/04/how-to-test-if-your-openssl-heartbleeds.html https://www.ssllabs.com/ssltest/ http://www.cnet.com/how-to/which-sites-have-patched-the-heartbleed-bug/