Tuesday 15 April 2014

Everything you need to know about the Heartbleed bug -PART 2

What is SSL?

SSL, short for Secure Sockets Layer, is a family of encryption technologies that allows web users to protect the privacy of information they transmit over the internet.
When you visit a secure website such as Gmail.com, you'll see a lock next to the URL, indicating that your communications with the site are encrypted. Here's what that looks like in Google's Chrome browser:
Screen_shot_2014-04-08_at_10
That lock is supposed to signal that third parties won't be able to read any information you send or receive. Under the hood, SSL accomplishes that by transforming your data into a coded message that only the recipient knows how to decipher. If a malicious party is listening to the conversation, it will only see a seemingly random string of characters, not the contents of your emails, Facebook posts, credit card numbers, or other private information.
SSL was introduced by Netscape in 1994. In recent years, there has been a trend toward major online services to using encryption by default. Today, Google, Yahoo, and Facebook all use SSL encryption by default for their websites and online services.
When implemented correctly, SSL is believed to be highly secure. But in 2014 a number of problems were found in widely used SSL software. In February, a serious flaw was discovered in Apple's implementation of SSL. The next month a a flaw was found another SSL implementation that was popular with open source operating systems. The most serious vulnerability, known as Heartbleed, was discovered in April. It affects OpenSSL, which is installed on a majority of the world's web servers.

What's OpenSSL?

OpenSSL is software that allows computers to communicate using the SSL encryption standards. It's an open source project created and maintained by volunteers. First released in 1998, it has become one of the most popular SSL implementations in the world.
OpenSSL is widely used. One reason for this is that it has been incorporated into various other software products. For example, two of the most popular web servers software packages, known as Apache and nginx, both use OpenSSL to encrypt websites.
OpenSSL project currently lists just 15 active developers who contribute to the project on a volunteer basis. But not all changes to the OpenSSL software are written by these 15 people. Rather, these developers help to filter and organize suggested changes from a larger community of people who make occasional contributions.
Considering that high-profile commercial software projects often have dozens or even hundreds of people working on them, it's not surprising that the OpenSSL team didn't notice the subtle Heartbleed bug when they introduced a new version of the software in 2012.


How does the heartbleed attack work?

The SSL standard includes a "heartbeat" option, which provides a way for a computer at one end of the SSL connection to double-check that there's still someone at the other end of the line. This feature is useful because some internet routers will drop a connection if it's idle for too long. In a nutshell, the heartbeat protocol works like this:
Heartbleed_good
The heartbeat message has three parts: a request for acknowledgement, a short, randomly-chosen message (in this case, "banana"), and the number of characters in that message. The server is simply supposed to acknowledge having received the request and parrot back the message.
The Heartbleed attack takes advantage of the fact that the server can be too trusting. When someone tells it that the message has 6 characters, the server automatically sends back 6 characters in response. A malicious user can take take advantage of the server's gullibility:
Heartbleed_bad
Obviously, the word "giraffe" isn't 100 characters long. But the server doesn't bother to check before sending back its response, so it sends back 100 characters. Specifically, it sends back the 7-character word "giraffe" followed by whichever 93 characters happen to be stored after the word "giraffe" in the server's memory. Computers often store information in a haphazard order in an effort to pack them into its memory as tightly as possible, so there's no telling what information might be returned. In this case, the bit of memory after the word "giraffe" contained sensitive personal information belonging to user John Smith.
In the real Heartbleed attack, the attacker doesn't just ask for 100 characters. The attacker can ask for around 64,000 characters of plain text. And it doesn't just ask once, it can send malicious heartbeat messages over and over again, allowing the attacker to get back different fragments of the server's memory each time. In the process, it can gain a wealth of data that was never intended to be available to the public.
The fix for this problem is easy: the server just needs to be less trusting. Rather than blindly sending back as much data as is requested, the server needs to check that it's not being asked to send back more characters than it received in the first place. That's exactly what OpenSSL's fix for the Heartbleed Bug does.

No comments:

Post a Comment