flawopen.com/安全事件/Heartbleed

Heartbleed 心脏滴血:一处缺失的边界检查,危及半个互联网的安全基石

Critical — Memory disclosure CWE-125: Out-of-bounds Read Disclosed 7 April 2014
通俗解释 (ELI5)

你对办公室的同事喊:'复述「猫」这个词,它有 1 个汉字。' 同事回答'猫'。接着你喊:'复述「猫」这个词,它有 6 万字长。' 同事没有核对实际长度,念完'猫'之后,顺着把桌上所有文件、别人留在桌上的密码和绝密私钥全部大声念了出来。

The fix is two comparisons. That ratio — a two-line check against a two-year, internet-wide exposure — is the reason Heartbleed became the standard illustration of how little code stands between working software and catastrophic failure.

Why remediation was so painful

Patching OpenSSL was the easy part. The hard part followed from a property of the bug: because it was silent and untraceable, no operator could prove they had not been exploited. With no logs to examine, the only defensible assumption was that every secret resident in the process memory during the exposure window had leaked.

That meant regenerating private keys, reissuing and revoking certificates at a scale the certificate authority ecosystem had never handled at once, invalidating every session, and prompting global password resets. Deployments without forward secrecy were worse off again: an attacker who had recorded encrypted traffic earlier could decrypt it retroactively once they held the key.

The lessons that actually transfer

FAQ

Why is it called an over-read rather than an overflow?

An overflow writes past a boundary, corrupting adjacent memory and often enabling code execution. An over-read only reads past it. Heartbleed never corrupted anything — it simply handed the attacker memory contents, which in this case was more than sufficient.

Could the private key really be recovered?

Yes. It was not guaranteed on any given request, but private key material can reside in the same heap. Repeated requests sampling different memory made recovery practical, and it was demonstrated publicly.

Related reading

参考资料与权威通告