Skip to content
Memory corruption Write-up Advanced

The Bug That Bled the Internet

The Heartbleed bug in OpenSSL's heartbeat extension lacked a bounds check, so a client could request more data than it sent and receive up to 64KB of server memory. An attacker could silently read private keys, passwords, session tokens and other sensitive data without leaving logs.

iamakkii20 Follow

Published on medium.com

In the world of cybersecurity, some bugs scream. Others whisper — slowly, invisibly bleeding data until it’s too late.

Ravi Patil, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The heartbeat handler copied the number of bytes requested by the client without checking that the request matched the actual payload length, so it read beyond the received message into adjacent memory.

Impact

Attackers could silently harvest private keys, passwords, session cookies and personal data without triggering alerts or logs, and the estimated cost exceeded $500 million.

What the attacker needed

Server runs vulnerable OpenSSL; attacker can send heartbeat requests

The fix

The vulnerability was fixed in OpenSSL 1.0.1g by adding a check that discards malformed heartbeat packets whose declared payload length exceeds the actual packet length.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

OpenSSL is a widely used library that handles encrypted connections. A feature meant to check that two computers are still connected trusted the client's claim about how much data it sent, so a malicious client could ask for far more data back and receive whatever happened to be in the server's memory, such as passwords or encryption keys.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.