Incidents & Vulnerabilities

Heartbleed (CVE-2014-0160) — an OpenSSL bug that leaked server memory

Heartbleed was a 2014 OpenSSL flaw that leaked server memory, including private keys. How the bug worked and the lessons: re-issue certs, rotate secrets.

Published 2026-06-07 Updated 2026-10-23 5 min read
On this page

Revisiting a major past incident for the lessons that still apply to your operations, from a defensive angle, not as a reproduction.

2014
discovered
~17%
TLS certificate survey at disclosure (2014)
private key
worst-case leak
no trace
detection difficulty

What happened: a bug that returned more data than requested

TLS (the encryption behind HTTPS) has a keep-alive "heartbeat" exchange. The client sends a little data plus a length ("send this back"), and the server echoes it. It is simple by design.

OpenSSL's implementation didn't validate the claimed length. Send a few bytes but claim "send 64KB back", and the server reads past your data into adjacent memory and returns it. If a private key or session sat there, it leaked too.

Normal: sent length = returned length

"return 'bird' (4 chars), length 4" → server: "bird"

↓ without validating the length…

Heartbleed: tiny payload + huge claimed length

"return 'bird' (4 chars), length 64KB" → server: "bird + 64KB of neighboring memory (may include keys, sessions)"

Normally you get back what you sent. Heartbleed trusted the claimed length and returned neighboring memory.

No special privileges were needed; repeating it collected fragments of memory bit by bit. A tiny bug in a TLS library that a huge amount of software depends on affected the security of HTTPS traffic worldwide.

A leak that leaves little trace can't be scoped

Heartbleed left little trace in normal access logs, so "did it leak" and "what leaked" were hard to assert. When in doubt, act on the worst case.

Timeline

  1. 2014-04-07

    The flaw is disclosed and a fixed OpenSSL ships the same day.
  2. right after

    Servers worldwide patch en masse; the breadth of impact causes alarm.
  3. afterward

    Many services revoke and re-issue certificates "assuming the key leaked", and ask users to change passwords.

Why patching alone doesn't finish the job

If the private key might have leaked, then even after patching, the old key is still valid. So the response has two parts: fix the vulnerability (patch), and rotate keys, certificates and secrets as if they leaked.

Insufficient response

  • Update OpenSSL and consider it "fixed"
  • Rotate only the one secret you confirmed abused
  • Keep using the same certificate

Correct response

  • Update and revoke/re-issue certificates (regenerate the private key)
  • Rotate every secret, key, and password the server holds
  • Prompt users to change passwords

Lessons that still apply

1

Act as if everything leaked

Rotate every secret, key, and password — not just the one you confirmed. When a leak leaves little trace, assume the worst.

2

Revoke and re-issue certificates

If the private key might have leaked, rebuild the certificate too. Until you rotate the key, a key that leaked in the past remains usable.

3

Monitor base libraries too

Track CVEs in base libraries like OpenSSL, not just your app. The more software depends on a library, the wider the impact.

4

Value memory safety

"Read more than requested" bugs shrink structurally with memory-safe design and languages. Factor it in when choosing the technology you build on.

Sources and scope

These primary references support the settings, scope or remediation discussed above; links were checked on October 23, 2026. Consult their version and configuration conditions. Checklist priorities and lessons are this site's guidance, not a full-article revalidation or a safety guarantee.

FAQ

QWhat could leak in Heartbleed?
A

Server memory: at worst the TLS private key, session contents, and login data. And it left little trace, so 'how much leaked' was hard to determine afterward.

QWhy did it 'return more than requested'?
A

In the keep-alive (heartbeat) exchange, the server trusted the length the peer claimed instead of checking it. Send a few bytes but claim '64KB back', and the server read past your data into adjacent memory and returned it. Trusting the input (the length) without checking it was the cause.

QWhat mattered most in the response?
A

After patching, acting as if everything leaked: revoking and re-issuing TLS certificates, and rotating every secret and password the server held. Patching the app alone wasn't enough.