Definition
Heartbleed
Heartbleed is a CVE for a vulnerability in OpenSSL 1.0.1 before 1.0.1g. It allows remote attackers to obtain sensitive information from process memory via crafted Heartbeat Extension packets that trigger a buffer over-read.
Mechanism
Missing bounds check on a user-controlled length
The Heartbeat extension keeps a TLS connection alive by echoing back a payload: the client sends a request with some bytes and a length field, and the server copies that many bytes from its memory and returns them. The bug was that OpenSSL used the attacker-supplied length as the byte count for the copy without checking it against the actual payload received. By sending a short payload with a large length field, an attacker could walk the copy past the payload and into the surrounding process memory, exfiltrating whatever happened to live there.
Impact
Why a single over-read was so damaging
Each malformed request leaked up to 64 KiB of process memory. The leaked bytes could contain the server’s private key, session tickets, or decrypted packets held in memory — so a single over-read made off with the long-term secret, after which the attacker could impersonate the server and decrypt captured traffic until the key was rotated. Memory is contiguous, and the missing bounds check turned that into a confidentiality breach: see memory safety for the broader pattern.