File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ layout : news_post
3+ title : " CVE-2026-27820: Zlib::GzipReader 中的缓存区溢出漏洞"
4+ author : " hsbt"
5+ translator : " GAO Jun"
6+ date : 2026-03-05 00:00:00 +0000
7+ tags : security
8+ lang : zh_cn
9+ ---
10+
11+ ` Zlib::GzipReader ` 中存在一个缓存区溢出漏洞。此漏洞的 CVE 编号为 [ CVE-2026 -27820] ( https://www.cve.org/CVERecord?id=CVE-2026-27820 ) 。
12+ 我们建议您更新 ` zlib ` gem。
13+
14+ ### 详情
15+
16+ ` zstream_buffer_ungets ` 函数会在生成的输出前加上调用者提供的字节,但没有确保对应的 Ruby 字符串的长度是否足够。
17+ 当缓冲区长度超过字符串容量时,将导致内存损坏。
18+
19+ ### 建议操作
20+
21+ 我们建议将 ` zlib ` gem 更新到 3.2.3 或后续版本。为了确保与较旧 Ruby 系列绑定版本的兼容性,您可以使用下面的方法进行更新:
22+
23+ * Ruby 3.2:更新到 ` zlib ` 3.0.1
24+ * Ruby 3.3:更新到 ` zlib ` 3.1.2
25+
26+ 您可以通过 ` gem update zlib ` 进行更新。如果您使用 bundler,请将 ` gem "zlib", ">= 3.2.3" ` 添加到 Gemfile 中。
27+
28+ ### 受影响版本
29+
30+ ` zlib ` gem 3.2.2 或之前发布的版本
31+
32+ ### 致谢
33+
34+ 感谢 [ calysteon] ( https://hackerone.com/calysteon ) 汇报此问题。同时感谢 [ nobu] ( https://github.com/nobu ) 制作了补丁。
35+
36+ ## 历史
37+
38+ * 最初发布于 2026-03-05 09:00:00 (UTC)
You can’t perform that action at this time.
0 commit comments