# 心脏出血

**心脏出血**（Heartbleed，CVE-2014-0160）是 OpenSSL 密码学库中的一个严重安全漏洞，于2014年4月7日披露。攻击者可利用该漏洞读取服务器或客户端内存中的部分内容，从而可能泄露 TLS 协议本应保护的密码、会话数据和私有加密密钥。<sup>[1](https://blog.mozilla.org/security/2014/04/08/heartbleed-security-advisory/)</sup><sup> • </sup><sup>[2](https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2014-0160)</sup> 该漏洞存在于 OpenSSL 对 TLS/DTLS 心跳扩展（RFC 6520）的实现中，其名称即源自这一“心跳”功能。<sup>[3](https://www.heartbleed.com/)</sup>

| 关键事实 | 详情 |
|---|---|
| 标识符 | CVE-2014-0160，OpenSSL 1.0.1 系列中早于 1.0.1g 的版本中 TLS 和 DTLS 实现的缓冲区过度读取<sup>[2](https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2014-0160)</sup> |
| 披露 | 2014年4月7日17:49 UTC 随 OpenSSL 1.0.1g 发布开始公开披露，20:37 UTC 发布安全公告<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> |
| 机制 | 伪造一个有效载荷长度大于实际有效载荷的心跳请求，导致对端每次请求最多返回 64 KB<sup>16</sup> 的相邻内存<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> |
| 发现 | 由谷歌安全团队的尼尔·梅塔（Neel Mehta）独立发现（2014年3月21日前），以及 Codenomicon 的安全工程师发现（4月2日）；芬兰国家网络安全中心（NCSC-FI）协调了响应工作<sup>[3](https://www.heartbleed.com/)</sup><sup> • </sup><sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> |
| 规模 | 据估计，Alexa 排名前一百万中启用 HTTPS 的服务器有24%至55%最初存在漏洞，包括 Alexa 前100名中的44个<sup>[5](https://www.eecs.umich.edu/cse/awards/pdfs/p475.pdf)</sup> |
| 响应 | 4月9日检测到的易受攻击主机中有73%在一个月内完成了修补，但仅10.1%更换了证书，其中14%重复使用了同一私钥<sup>[6](https://faculty.cc.gatech.edu/~frankli/papers/li-imc2014.pdf)</sup> |
| 后续 | OpenSSL 基金会于2014年成立，直接回应了该漏洞所暴露的资金和治理问题<sup>[7](https://openssl.foundation/about/history)</sup> |

## 心跳扩展与漏洞

心跳扩展以 RFC 6520 于2012年2月发布，允许 TLS 或 DTLS 连接的任何一端在不进行昂贵的重新协商的情况下验证对端是否仍然存活；其主要动机是 DTLS 中的会话管理，因为 DTLS 运行在不可靠传输之上。<sup>[8](https://datatracker.ietf.org/doc/html/rfc6520)</sup> 心跳消息包含一个单字节类型字段、一个双字节有效载荷长度字段、一个有效载荷以及至少16字节的随机填充，接收方必须在响应中回显该有效载荷。<sup>[8](https://datatracker.ietf.org/doc/html/rfc6520)</sup> 该扩展于2011年12月31日被加入 OpenSSL，并于2012年3月14日在 OpenSSL 1.0.1 中发布。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup>

该漏洞是一个缺失的边界检查。OpenSSL 信任了攻击者控制的报文中由攻击者指定的长度：当请求声明的有效载荷长度大于实际发送的数据时，服务器会将声明长度的内存复制到响应中，泄露进程内存中有效载荷之后的任何内容。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> 由于长度字段为两个字节，每个精心构造的请求最多可提取约 64 KB<sup>16</sup>，攻击者可以反复发送请求，系统性地抽取服务器内存，包括私有加密密钥和通过安全通道传输的数据。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> 修复方法只是一个简单的边界检查，丢弃任何声明长度超过有效载荷的请求，但其潜在影响十分严重。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup>

若干特性使该漏洞异常危险。它不需要中间人位置；攻击者可以直接联系易受攻击的服务。<sup>[3](https://www.heartbleed.com/)</sup> 客户端证书认证也无济于事，因为心跳请求在握手阶段、认证发生之前就会被应答。<sup>[3](https://www.heartbleed.com/)</sup> 而且该攻击在设计上不留痕迹：正如 Mozilla 在其公告中所指出的，受害者无法从日志中判断是否发生了利用行为。<sup>[1](https://blog.mozilla.org/security/2014/04/08/heartbleed-security-advisory/)</sup>

## 发现与披露

谷歌计算机安全员工[尼尔·梅塔](https://www.edgepedia.org/zh/neel-mehta)于2014年3月发现了该漏洞；谷歌修补了自家服务器，并于4月1日通知了 OpenSSL 核心团队。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> 与此同时，安全测试公司 Codenomicon 在改进其 Defensics 测试工具的 SafeGuard 功能时，于4月2日独立发现了该漏洞，并报告给芬兰国家网络安全中心（NCSC-FI），该中心承担了验证、分析以及与受影响供应商的联络工作。<sup>[3](https://www.heartbleed.com/)</sup><sup> • </sup><sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> 在得知两个团队独立发现了该漏洞后，OpenSSL 核心团队决定发布修补版本。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup>

公开披露始于2014年4月7日，OpenSSL 1.0.1g 发布公告于17:49 UTC 发出，公开安全公告于20:37 UTC 发出。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> 一些大型运营商，包括 CloudFlare、Akamai 和 Facebook，事先获得了私下通知，而 [Red Hat](https://www.edgepedia.org/zh/red-hat)、SuSE、Debian、FreeBSD 和 ALT Linux 在披露前不到24小时才被告知；Ubuntu、Gentoo、Chromium、Cisco 和 Juniper 则是在漏洞公开时才得知。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> Codenomicon 于4月5日注册了 heartbleed.com 域名，并在公告发布的同时推出了该漏洞的名称、标志和专门网站——这一专业化的品牌披露方式后来被 Axios 描述为为安全研究面向公众的传播设定了新的默认范式。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup><sup> • </sup><sup>[9](https://www.axios.com/2019/04/11/cybersecurity-heartbleed-vulnerability-branding)</sup>

## 影响与测量

心脏出血可能影响任何使用 OpenSSL 进行 TLS 连接的服务，包括流行的 Web、邮件、即时通讯和数据库服务器。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> 由扎基尔·杜鲁梅里克（Zakir Durumeric）和 J. 亚历克斯·哈尔德曼（J. Alex Halderman）领导的密歇根大学团队——哈尔德曼是密歇根大学计算机科学教授，主管计算机安全与社会中心——使用 ZMap 扫描工具针对 Alexa 排名前一百万的域名和公共 IPv4 地址空间的1%样本测量了该漏洞的影响范围。<sup>[10](https://systems.engin.umich.edu/stories/computer-scientists-win-best-paper-award-at-2014-acm-internet-measurement-conference)</sup> 他们的论文《心脏出血之事》（“The Matter of Heartbleed”）获得了2014年 ACM 互联网测量会议最佳论文奖；论文指出，Alexa 排名前一百万中启用 HTTPS 的服务器最初存在漏洞的比例为24%至55%，其中包括 Alexa 前100名中的44个站点。<sup>[10](https://systems.engin.umich.edu/stories/computer-scientists-win-best-paper-award-at-2014-acm-internet-measurement-conference)</sup><sup> • </sup><sup>[5](https://www.eecs.umich.edu/cse/awards/pdfs/p475.pdf)</sup>

同样的测量追踪了恢复情况，结果喜忧参半：

- 披露后的头两周修补力度很大，但随后趋于平缓；两个月后，Alexa 排名前一百万中仍有3%的 HTTPS 站点存在漏洞。<sup>[5](https://www.eecs.umich.edu/cse/awards/pdfs/p475.pdf)</sup>
- 在易受攻击的站点中，73%在一个月内完成了修补，但仅10.1%更换了证书，而在更换证书的站点中仅19%吊销了原证书；14%重复使用了同一私钥，这对于已经复制了该私钥的攻击者而言毫无防护作用。<sup>[6](https://faculty.cc.gatech.edu/~frankli/papers/li-imc2014.pdf)</sup>
- 在没有前向保密的情况下，攻击者若记录了先前的 TLS 流量，随后通过心脏出血获取了服务器私钥，便可解密那些过去的通信。<sup>[11](https://www.cs.virginia.edu/~ys3kz/courses/spring20/cs6501/papers/Heartbleed14.pdf)</sup>
- 研究人员未发现公开披露之前有大范围攻击的证据，但漏洞扫描在22小时内就开始了，披露后攻击者从692个来源发起了多种不同类型的攻击。<sup>[5](https://www.eecs.umich.edu/cse/awards/pdfs/p475.pdf)</sup>
- 向数十万台服务器的运营者直接发送通知，使该人群的修补率提高了近50%。<sup>[10](https://systems.engin.umich.edu/stories/computer-scientists-win-best-paper-award-at-2014-acm-internet-measurement-conference)</sup>

Mozilla 自身的公告说明了大型服务所面临的风险：其 Persona 和 Firefox Account 的 TLS 连接终止于运行易受攻击 OpenSSL 的[亚马逊](https://www.edgepedia.org/zh/amazon-company)弹性负载均衡器上，直到亚马逊于4月8日修复 AWS；这可能泄露 TLS 私钥、会话令牌和传输中消息的明文；Mozilla 重新生成并吊销了密钥，并作为预防措施吊销了所有 Persona 持有者令牌，同时声明没有证据表明发生了实际入侵。<sup>[1](https://blog.mozilla.org/security/2014/04/08/heartbleed-security-advisory/)</sup>

## 公众与行业反应

该漏洞进入了公众视野。[皮尤研究中心](https://www.edgepedia.org/zh/pew-research-center)对1501名美国成年人进行了一项调查，误差范围约为正负2.9个百分点，发现64%的互联网用户听说过心脏出血，但只有39%的人因此更改了密码或删除了账户；仅29%的人认为自己的个人信息面临风险，6%的人认为信息已被窃取，尽管该漏洞的性质使得通常无法判断个别账户是否遭到入侵。<sup>[12](https://time.com/82454/heartbleed-passwords/)</sup>

评论者批评大公司依赖 OpenSSL 却不提供资金支持——OpenSSL 由一小群基本没有资金支持的志愿者维护；谷歌和微软等公司随后承诺为包括 OpenSSL 在内的开源项目提供资金。<sup>[12](https://time.com/82454/heartbleed-passwords/)</sup> OpenSSL 基金会将成立时间定为2014年，称心脏出血是其创立的推动力——世界意识到全球数据基础设施在多大程度上依赖少数资金不足的开发者。<sup>[7](https://openssl.foundation/about/history)</sup> OpenSSL 项目本身将这一事件描述为分水岭：几行错误代码悄无声息地混入，使五十万个网站处于风险之中，促使各公司争相在关键数据被窃取之前完成修补。<sup>[7](https://openssl.foundation/about/history)</sup>

## 持续存在与遗产

修复发布很久之后，心脏出血在未修补的系统上仍可利用。披露三年后，Shodan 搜索引擎仍发现近20万台联网的易受攻击设备，其中 [Apache HTTP Server](https://www.edgepedia.org/zh/apache-http-server)（尤其是2.2.22和2.2.15版本）是受影响最多的产品，Linux 3.x 是受影响最多的操作系统。<sup>[13](https://www.securityweek.com/heartbleed-still-affects-200000-devices-shodan/)</sup> 后来的一次 Shodan 分析仅在美国就统计到至少3.4万台仍存在漏洞的设备，集中在 CradlePoint 无线路由器和 Watchfire 数字广告牌等嵌入式系统上，而非普通 Web 服务器。<sup>[14](https://help.shodan.io/data-analysis/ssl-analysis-by-country)</sup>

这一事件也改变了漏洞的命名和资助方式。心脏出血带有标志和网站的品牌化披露，为后来的 Shellshock、Dirty COW 和 [Log4Shell](https://www.edgepedia.org/zh/log4shell) 等漏洞树立了模板，尽管安全研究人员指出品牌化可能夸大不太严重的漏洞。<sup>[9](https://www.axios.com/2019/04/11/cybersecurity-heartbleed-vulnerability-branding)</sup> 在 OpenSSL 自身的历史中，该项目将心脏出血列为其影响最大的漏洞之一，因为它泄露了私钥和用户数据，易于利用，且恰逢 HTTPS 和其他 TLS 服务已广泛普及之时。<sup>[4](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)</sup> 后来的 OpenSSL 安全公告——例如2022年11月的严重级漏洞修复，该项目曾警告其严重程度可能与心脏出血相当，后将其降级为高危级——都被习惯性地拿来与2014年的这一事件进行比较。<sup>[15](https://www.axios.com/2022/11/01/openssl-code-library-security-patch-open-source)</sup>

## References

1. [Heartbleed Security Advisory, Mozilla Security Blog (April 8, 2014)](https://blog.mozilla.org/security/2014/04/08/heartbleed-security-advisory/)
2. [CVE-2014-0160, MITRE CVE Dictionary](https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2014-0160)
3. [Heartbleed Bug FAQ, heartbleed.com (Codenomicon)](https://www.heartbleed.com/)
4. [Durumeric, Z. et al. (2014). "The Matter of Heartbleed," ACM Internet Measurement Conference](https://www.icir.org/vern/papers/heartbleed-imc14.pdf)
5. ["The Matter of Heartbleed" (conclusion and findings), University of Michigan](https://www.eecs.umich.edu/cse/awards/pdfs/p475.pdf)
6. [Li, F. et al. (2014). "The Matter of Heartbleed," certificate replacement analysis](https://faculty.cc.gatech.edu/~frankli/papers/li-imc2014.pdf)
7. [History of OpenSSL Foundation, OpenSSL Foundation](https://openssl.foundation/about/history)
8. [RFC 6520: TLS/DTLS Heartbeat Extension, IETF (February 2012)](https://datatracker.ietf.org/doc/html/rfc6520)
9. [How Heartbleed turned vulnerabilities into brands, Axios (April 11, 2019)](https://www.axios.com/2019/04/11/cybersecurity-heartbleed-vulnerability-branding)
10. [Computer Scientists Win Best Paper Award at 2014 ACM Internet Measurement Conference, University of Michigan](https://systems.engin.umich.edu/stories/computer-scientists-win-best-paper-award-at-2014-acm-internet-measurement-conference)
11. ["The Matter of Heartbleed" (course copy with forward secrecy discussion), University of Virginia](https://www.cs.virginia.edu/~ys3kz/courses/spring20/cs6501/papers/Heartbleed14.pdf)
12. [Only 4 in 10 Internet Users Changed Passwords After Heartbleed, Poll Finds, Time (April 30, 2014)](https://time.com/82454/heartbleed-passwords/)
13. [Heartbleed Still Affects 200,000 Devices: Shodan, SecurityWeek (2017)](https://www.securityweek.com/heartbleed-still-affects-200000-devices-shodan/)
14. [Understanding SSL by Country, Shodan Help Center](https://help.shodan.io/data-analysis/ssl-analysis-by-country)
15. [OpenSSL code library patched after high-risk vulnerabilities found, Axios (November 1, 2022)](https://www.axios.com/2022/11/01/openssl-code-library-security-patch-open-source)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Malware and endpoint threats › Named malware specimens

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/heartbleed

English original: https://www.edgepedia.org/heartbleed
