Learn / Famous incidents explained
Heartbleed (2014)
A tiny bug in the OpenSSL encryption library let anyone read chunks of server memory, exposing passwords and private keys across the web.

What happened
On April 7, 2014, the maintainers of OpenSSL disclosed a serious flaw and released a fix. OpenSSL is free, open-source software that provides the encryption behind HTTPS (the padlock in your browser) on a large share of the world's web servers, as well as in email servers, VPNs and many devices. The flaw, tracked as CVE-2014-0160, was found independently by researchers at Google and at the security company Codenomicon, and was given the memorable name Heartbleed along with its own website and logo, which helped it reach the general public.
The bug had been present since OpenSSL version 1.0.1, released in early 2012, so vulnerable servers had been exposed for about two years before anyone announced it. Affected versions were 1.0.1 through 1.0.1f; version 1.0.1g fixed it.
How it worked
Encrypted connections using TLS can send small "heartbeat" messages to check that the other side is still there. The client sends a bit of data plus a number stating how long that data is, and the server echoes the same data back.
OpenSSL trusted the length the client claimed without checking it against the data actually sent. If a client sent one byte but claimed it was much longer, the server copied that many bytes from its memory into the reply, up to about 64 kilobytes per request. That extra memory could contain whatever the server had been working on: other users' session cookies, usernames and passwords, and in some cases the server's private encryption key.
Two features made it worse. Attackers could repeat the request as often as they liked, collecting new chunks each time, and the requests normally left no trace in server logs.
Impact
Researchers estimated at the time that a large fraction of secure web servers were vulnerable. Website operators had to patch OpenSSL, generate new encryption keys, revoke and replace their certificates, and in many cases ask users to change passwords. Some confirmed thefts of data using Heartbleed were reported in the weeks after disclosure. The flaw also affected routers, phones and other devices whose software was rarely updated, so vulnerable systems lingered for years.
What defenders learned
- Critical open-source projects need funding. OpenSSL was maintained by a very small team with little money. The Linux Foundation responded by creating the Core Infrastructure Initiative to fund essential open-source projects, an effort later folded into the Open Source Security Foundation.
- Check every length. Heartbleed is a textbook example of trusting input from the network. It renewed interest in safer programming languages and automated testing techniques such as fuzzing.
- Know what you run. Many organizations struggled to find every copy of OpenSSL in their products, an early lesson in keeping a software inventory.
- Forward secrecy matters. Connections using forward secrecy were better protected, because a stolen key could not decrypt previously recorded traffic.
What it means for you
You could not have prevented Heartbleed as a user, but you could limit the damage. People who used unique passwords for each site only had to worry about the services that were affected. People who reused one password everywhere had to change it everywhere.
- Use a password manager so every password is unique.
- Turn on two-factor authentication, so a leaked password alone is not enough.
- Keep routers, cameras and other devices updated, or replace them when the maker stops providing updates. See software updates.
