The Heartbleed bug explained

I have received a lot of requests from people outside of the IT field to explain the Heartbleed bug in easy-to-understand terms. Rather than attempt to reinvent the wheel, I have published below (with some editing for clarity) what is probably the best attempt at this that I have read so far. It was written by Stack Exchange user SPRBRN.

###

The Bank Employee and the Customer

The main characters in this story

  • The bank: A Web server
  • The bank employee: The OpenSSL service for the Web server
  • The bank customer: A bot fetching all information it can get from that server

You, the bank customer, call the bank to request a new bank account. Somehow you and the bank make sure that you are who you say you are, and that the bank is actually the bank. This is the TLS process that secures the connection between you and the bank.

Staying connected – the heartbeat

You are now connected to the appropriate bank employee, and you request some information about opening a new account. The employee puts you on hold and disables his headset microphone. He can hear you, but you cannot hear him. Then it’s quiet for a long time and you start to wonder if he hung up.

With this particular bank employee, you need to first tell him how many words you are going to use before you ask him if he is still online. So, instead of just saying, “Hello”, you need to say “one: hello?” or “two: hello there.” In the second case, the employee knows he can reply by simply repeating the two word phrase, “Hello there” back to you, letting you know that he’s still on the line, and he can then continue to work on your request. This is the heartbeat protocol.

The problem – the heartbleed – no check on what is returned

You get bored while waiting for your request to be processed, and you make a joke. You say “one thousand: hello.” The bank employee doesn’t notice that you only said one word (not one thousand) and replies with, “Hello” plus the next 999 words that he says, or thinks about, or has in his memory, before turning his microphone off. This is the bug that causes the problem.

Those 999 words are unrelated. Most of them will be useless information like remarks about the weather, current interest rates, discussions about different kinds of checking accounts, etc. However, some of these words can contain important information about the bank or other customers, a transport of gold bullion, a customer who is going to bring in one million dollars in cash, and the combination for entering the bank safe.

You can perform this request over and over again and the employee won’t complain; and no one else is going to notice what is happening.

There is one limit. You will only get information from this one bank employee, and only the information that he knows or thinks about. Other employees are not affected. Also, you cannot see what is on his desk or in his Rolodex. Only data stored in RAM is at risk; data on the hard disk which is not read into memory and data from other programs and processes is safe.

Naturally, you don’t know what information you’ll get. But, if you do this enough times, you’ll get enough information to finally be able to break in to the bank without anyone noticing. You can enter the bank after hours, open the safe, and empty it. This is the vulnerability.

The solution

If the bank employee would stop and think for a moment, he would only reply with one word to your “one thousand : hello” statement and disable the microphone so you cannot hear anything else he is saying. By making this check, the bank employee will ensure that you will stay connected and know that he has not hung up, but you will not be made privy to any random information. Essentially, the employee needs new instructions on what to echo back to you. This vulnerability is fixed by updating the Web server to the latest version of OpenSSL.

Of course, there is no guarantee that someone hasn’t already gotten the combination to the bank’s vault. So, the bank must change the combination. Users that login to the Web server must change their login credentials.

###

In technical computer science lingo:  Heartbleed is a read-overrun bug in the implementation of the TLS (Transport Layer Security) protocol’s ‘heartbeat’ extension. The heartbeat checks with a Web server to ensure that it’s connected and can respond. If exploited, the bug leaks memory contents from the server to the client and vice versa, possibly exposing passwords and other sensitive data (and, potentially, the SSL server’s private key).

OpenSSL Versions 1.0.1 and 1.0.2 beta are affected by the Heartbleed bug, which was discovered by security researchers at Google and Codenomicon. OpenSSL has since issued an update that fixes the bug, and users are advised to change their passwords for any sites that were impacted.

Facebooktwittergoogle_pluspinterestlinkedintumblrmail  rss