- Impact: How prevalent is it – in other words, how many systems and services are potentially affected. Also, how many users are potentially affected.
- Severity - How much damage can it do – what is capable of giving or exposing and to whom?
- Difficulty - How difficult is it to exploit – do you need special access or knowledge, etc. This would also include whether an exploit has been made available “in the wild”.
Friday, April 18, 2014
A Layman’s Guide to Heartbleed
A Layman’s Guide to Heartbleed, David Pitts, April 18, 2014
Originally published on http://www.dpitts.com/2014/04/a-laymans-guide-to-heartbleed.html
The modern world relies on computer security. Unfortunately, the modern world also takes security for granted. My goal with this article is to write about the Heartbleed security flaw so that non-technical people can understand what it is, what its impact is, and how to help protect themselves and to be able to have an intelligent discussion about it. I try to limit the technical jargon, but given it is a technical topic, some will have to be there. The reader can search the internet for “CVE-2014-0160” or visit http://heartbleed.com/ to get a more technical understanding.
The Heartbleed security flaw has been all over the news the past couple weeks and rightfully so. Its official reference is “CVE-2014-0160”, but that’s hard to remember and hard to sensationalize in the news. The flaw is part of the software that allows and responds to “heartbeat” requests. So, it gets called the Heartbleed bug as a play on words. This is (hopefully) the worst security flaw the computing world will see exposed this year. I say this, not because I know what has yet to be exposed, but because I understand what this one does and can do. Generally when I think about security I break it down into three major factors – impact, severity, and difficulty.
For Heartbleed, it is the trifecta of security flaws. It has very high impact, very high severity, and very easy to exploit.
What is it
Heartbleed is the term that has been given for a flaw in some software used to encrypt data. It is not a virus. You can’t update your antivirus and be protected. The software is part of the OpenSSL project. The particular bug was in the transport layer security protocol. If you want to know more about the heartbeat protocol, search the internet for RFC6520.
Where is it
It is used for web sites, network equipment, mobile phones, firewalls, etc. Basically, it could be anywhere where developers have wanted to secure a transmission and have used this library. The fix, therefore, is for organizations to be responsible and to fix their services. According to heartbleed.com, about 2/3rds of all servers on the internet use software that uses the OpenSSL library. Some percentage of those potential servers was actually affected.
Why is it
It was a human mistake. One of the nice things about open source is if you have the inclination, you can see who wrote the code, when it was made part of the library and actually look at the code.
It was found by several groups around the same time. Google reported it on April 1, 2014, Codenomicon (a Finnish cybersecurity company) discovered it on April 3rd. They are the ones that named it and then put up the heartbleed.com web site to explain it to the public. In giving these dates, I am presuming that some security agency didn’t find it before then, so they don’t get credit. The bug was analyzed and verified. The organizations contacted the OpenSSL group and reported the flaw. A patch was put in place and released on April 7th and the bug was publicly disclosed the same day. The code that introduced the bug was written in 2011 and became part of OpenSSL March, 2012. Rumor has it various entities have been exploiting this bug for months if not years. One such story was published here: http://arstechnica.com/security/2014/04/heartbleed-vulnerability-may-have-been-exploited-months-before-patch/. I’m a fairly paranoid person, so I don’t believe that two independent organizations within two days of each other found the same bug. I would be more willing to believe they were led that direction or that they were working together or that they were tipped off, or some other such story. I just have a hard time suspending my disbelief for such a coincidence.
What does it do
The heartbeat protocol is a way to keep a communication conversation from timing out. It ensures that the peer can be reached and is alive. In computing terms, starting and shutting down a secure communication stream is much more work for the computers than maintaining an open connection. The basic concept is that almost any time a “heartbeatrequest” can be sent. The receiver then responds with a “heartbeatresponse”
But, what does it respond with? Since computers can’t do random, it can’t pull something out if its magic hat, instead it pulls data from memory somewhere near what it is working with. As a heartbeat response is just supposed to be a single character response, pretty much any single character response will do. (I am reminded of Sean Connery’s character in The Hunt for Red October requesting “just one ping please” - https://www.youtube.com/watch?v=jr0JaXfKj68.)
If that was the extent, then there wouldn’t be a problem. The problem is that the way the code was written, the requestor can change the size of the request. Instead of one character, say an “A”, it can request up to 64K of data. That is 64536 sequential characters from memory. Technically speaking, the memory that it is reading has been marked to be reused. However, computers don’t clear out the old data, it just over writes it. I used to do the same thing with my file folders. I had a file folder labeled “Windows NT”. I then took another label and put it on it that said “Red Hat Linux”. If you lift up the old label you can still read the label underneath. To put it another way, let’s say you ask me for a playing card. I’m supposed to give you one playing card. So, I reach in, and I pull out a playing card and I give it to you. You then come back and say, “Hey, I want a playing card, give me 10 of them.” So, I see the request for a playing card, and I give you 10 of them (or sixty-four-thousand of them).
Another aspect of this bug that makes it even more insidious is that in by far the majority of the cases, the exploit is not logged. The device being affected would have to monitor both the incoming and outgoing traffic and notice that a single byte was requested but more than one byte was delivered. The request isn’t going to a normal service (such as the web server itself), so that service is not logging it. When you hear it said that there is no indication that it has been exploited. The statement is true. However, the statement means nothing. I don’t know Latin, but I’m sure there is some Latin phrase that means “listener beware because the speaker is spouting doo-doo”, maybe something like “Qui audit, dicentis implebitur fimo” if http://translate.google.com is to be believed.
As a consumer, what should I do?
This is the tough part. The real answer depends on many factors. I used to say that there is no such thing as security. The only way to make a computer secure, is to unplug it, put it in concrete, once the concrete sets, dig a deep hole, put it in the hole, bury it, and then forget where you buried it. However, I am not convinced that this is secure either.
The question is really about what is secure enough? The data you have on a social media account (Facebook, Twitter, Google+, Youtube, Pinterest, etc.) is supposed to be fairly public. The data you have at your bank or the doctor’s office is supposed to be fairly private. Now, treat it that way.
The media is telling you to change your passwords. This is a good idea. However, if the service is still vulnerable, then changing your password doesn’t help much, does it? So, you want to make sure that the service you are using and care is secure is not vulnerable – at least as best you can.
Unfortunately there are a couple problems here.
First, at least in the United States, there have been laws on the books since the mid 1980’s trying to define what is legal and what is not. I’m not a lawyer and I don’t play one on the internet. There are people trying to figure this stuff out (http://www.fas.org/sgp/crs/misc/RS20830.pdf for example), but it seems to be a slippery slope. If you test the service, you may or may not be violating laws.
Second, the current set of tools is only partially accurate. Many organizations have released heartbleed checkers that you can run against websites, add as extensions to browsers, etc. While I do not endorse any of them, the list includes http://filippo.io/Heartbleed/, https://lastpass.com/heartbleed/, https://chrome.google.com/webstore/detail/chromebleed/eeoekjnjgppnaegdjbcafdggilajhpic. What the industry is finding is that various tools are looking for something specific that may or may not be accurate.
In the US we live in a world where we feel we have very little control. The rich, the law breakers, the “man”, or whoever, makes the rules and all we can do is try to cope as best we can within the constraints we are given. Public awareness is probably the greatest tool.