Skip to main content

How the Heartbleed bug works, as explained by a Web comic

the heartbleed bug explained by a web comic xkcd bleeding heart
Image used with permission by copyright holder

Sometimes, the easiest way to explain a concept to someone is with the use of illustrations, or cartoons. Xkcd.com attempts to do just that with this simple comic, where it tells a short story of a hacker talking to a server, who uses the Heartbleed exploit to trick the server into leaking more information it’s supposed to, until it begins to divulges sensitive data.

First, check the comic out below.

heartbleed_explanation
Image used with permission by copyright holder

First the girl asks the server to indicate whether it’s still online by telling it to say “Potato,” and indicates the length of the word. The server responds with “Potato,” while withholding all of the information surrounding “Potato,” written out in a lighter hue in the server’s speech bubbles. The hacker then asks the server to repeat the same task, but instead replaces “Potato” with “Bird,” and indicates the length of the word. The server complies.

Then, the hacker asks the server to say “Hat,” but instead of noting that it’s a three-character word, she states that it’s 500 letters long. The server responds not only by saying “Hat,” but also by leaking out the information around the word. By doing so, it reveals sensitive server information, including a “master key,” which the hacker begins to jot down.

This is a basic explanation of how the Heartbleed bug works. The Heartbleed bug is a flaw in the OpenSSL method of data encryption used by many of the world’s websites, which was actually put into the code accidentally by a programmer roughly two years ago.

OpenSSL contains a function known as a heartbeat option. With it, while a person is visiting a website that encrypts data using OpenSSL, his computer periodically sends and receives messages to check whether both his PC and the server on the other end are both still connected. The Heartbleed bug allows hackers to send trick heartbeat messages, like the one pictured in the comic above, which can fool a site’s server into relaying data that’s stored in its RAM — including sensitive information such as usernames, passwords, credit card numbers, emails, and more. This is the part of the flaw that the Xkcd comic illustrates.

What do you think? Sound off in the comments below.

Editors' Recommendations

Konrad Krawczyk
Former Digital Trends Contributor
Konrad covers desktops, laptops, tablets, sports tech and subjects in between for Digital Trends. Prior to joining DT, he…
Best Dell laptop deals: Cheap laptops starting at $280
The Dell XPS 13 9315 on a table against a window.

If you're looking to pick up a new laptop, then Dell is one of the best laptop brands out there and has a multitiude of optoins for you to pick from depending on your needs. For example, Dell has both Alienware and G-Series which are some of the best gaming laptops on the market, and the Dell XPS lineup are some of the best laptops on the market and are made to compete with the MacBook. But that doesn't mean that Dell only has high-end gear for you to pick, and there are absolutely some great budget laptops and starter options.
Of course, having so many options can be a bit overwhelming for somebody who isn't familiar with Dell or the laptop market, which is why we scoured the Dell website for our favorite picks and listed them below. So, be sure to see if there's anything in here that tickles your fancy, and if not, check out some of these other great laptop deals as well.

Dell Inspiron 15 -- $280, was $330

Read more
iMac deals: New, renewed and refurbished iMac computers
Apple iMac with Retina 5K Display review close

If you're in the Apple ecosystem and need a desktop computer rather than something like a MacBook, then you'll want to go for the Apple iMac, which is one of the best all-in-one computers on the market. There are quite a few screen sizes and specs to pick from, and if you're willing to go for a renewed option, you can get some older, yes still powerful, iMacs for a great price. Even if you aren't, there are still some great Apple deals you can take advantage of to save yourself some money, which is why we went out and scoured the internet for the best deals we could find.
Apple 21.5-inch iMac (2018) Renewed -- $409, was $460

Even cheaper than any of the MacBook deals going on, this Apple 21.5-inch iMac (2018) might be a few years old but it offers plenty of juice for the price. That's the beauty behind many iMacs -- they last a long time thanks to offering reliable hardware and the benefits of MacOS, which tends to mean they stay fast for awhile. In the case of the 2018 21.5-inch iMac, you get a 2.7GHz Quad-Core Intel Core i5 processor paired up with 16GB of memory which is a great set of specs for ensuring you can get plenty of work done.

Read more
How to transfer photos from an iPhone to a computer
The Apple iPhone 15 Plus's gallery app.

As the old saying goes, the best camera is the one you always have with you. If you're like most iPhone users, that means you've likely amassed a sizeable collection of photos on your device. However, while Apple's Photos app is a great way to manage and view your photo library, it's never a good idea to keep all your eggs in one basket. After all, suffering a lost or broken iPhone is painful enough without also losing all your precious digital memories in the process.

Even if you're backing up your iPhone to iCloud or your computer, it's a good idea to keep your photos backed up separately. After all, opening a folder or a photo management app is a much easier way to get at your photos than trying to extract them from an iCloud or iTunes/Finder backup, which requires either restoring them to another iPhone or relying on special software tools.

Read more