CVE-2026-27820 json
zlib: Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption
published 2026-04-16 6 mo ago modified 2026-10-26 13 d ago also GHSA-g857-hhfv-j68w , EUVD-2026-23278
- cvss
- 9.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.6%
- EPSS 0.6% chance of exploitation in 30 days, percentile 46%
- public exploits
- 0
- none known
Summary
zlib is a Ruby interface for the zlib compression/decompression library. Versions 3.0.0 and below, 3.1.0, 3.1.1, 3.2.0 and 3.2.1 contain a buffer overflow vulnerability in the Zlib::GzipReader. The zstream_buffer_ungets function prepends caller-provided bytes ahead of previously produced output but fails to guarantee the backing Ruby string has enough capacity before the memmove shifts the existing data. This can lead to memory corruption when the buffer length exceeds capacity. This issue has been fixed in versions 3.0.1, 3.1.2 and 3.2.3.
Patch / fix
- rubygems zlib 3.0.1, 3.1.2, 3.2.3
- ruby-lang zlib 3.0.1, 3.1.2, 3.2.3
- ruby3.3 Debian 13 3.3.13-0+deb13u1
debian advisories DEBIAN-CVE-2026-27820
- ruby2.3 Ubuntu Pro 16.04 LTS 2.3.1-2~ubuntu16.04.16+esm15
ubuntu advisories UBUNTU-CVE-2026-27820
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- ruby RHEL 9 3.3.12-8.module+el9.8.0+24568+2bbebe96
- rubygems RHEL 9 3.5.22-8.module+el9.8.0+24568+2bbebe96
- ruby-libs RHEL 9 3.3.12-8.module+el9.8.0+24568+2bbebe96
- rubygem-pg RHEL 9 1.5.4-2.module+el9.8.0+24356+77305e91
- rubygem-irb RHEL 9 1.13.1-8.module+el9.8.0+24568+2bbebe96
- rubygem-rbs RHEL 9 3.4.0-8.module+el9.8.0+24568+2bbebe96
- rubygem-rss RHEL 9 0.3.1-8.module+el9.8.0+24568+2bbebe96
- rubygem-json RHEL 9 2.7.2-8.module+el9.8.0+24568+2bbebe96
red hat advisories RHSA-2026:50828RHSA-2026:50827RHSA-2026:50778RHSA-2026:50773RHSA-2026:50728RHSA-2026:8838
- ruby2.5 SLE Module for Basesystem 15 SP7 2.5.9-150700.24.6.1
suse advisories SUSE-SU-2026:1066-1
- ruby3.4 openSUSE Leap 16.0 3.4.10-160000.1.1
opensuse advisories openSUSE-SU-2026:21878-1
- ruby AlmaLinux 8 3.3.12-8.module_el8.10.0+4241+4264e34b
- rubygems AlmaLinux 8 3.5.22-8.module_el8.10.0+4241+4264e34b
- ruby-libs AlmaLinux 8 3.3.12-8.module_el8.10.0+4241+4264e34b
- rubygem-pg AlmaLinux 8 1.5.4-1.module_el8.10.0+3799+191214cc
- rubygem-irb AlmaLinux 8 1.13.1-8.module_el8.10.0+4241+4264e34b
- rubygem-rbs AlmaLinux 8 3.4.0-8.module_el8.10.0+4241+4264e34b
- rubygem-rss AlmaLinux 8 0.3.1-8.module_el8.10.0+4241+4264e34b
- rubygem-abrt AlmaLinux 8 0.4.0-1.module_el8.10.0+3799+191214cc
almalinux advisories ALSA-2026:50728ALSA-2026:50773ALSA-2026:50778ALSA-2026:50827ALSA-2026:50828
- ruby4.0 Rocky Linux 10 4.0.6-36.el10_2
- ruby Rocky Linux 10 3.3.12-14.el10_2
- ruby Rocky Linux 9 4.0.6-34.module+el9.8.0+40271+b5850c84
- rubygem-pg Rocky Linux 9 1.6.3-1.module+el9.8.0+40094+ce01217c
- rubygem-mysql2 Rocky Linux 9 0.5.7-1.module+el9.8.0+40094+ce01217c
- ruby Rocky Linux 9 3.3.12-8.module+el9.8.0+40270+7a73441e
- rubygem-pg Rocky Linux 9 1.5.4-2.module+el9.7.0+40188+314ad260.0.1
- rubygem-mysql2 Rocky Linux 9 0.5.5-3.module+el9.7.0+40032+36e56d0d
rocky linux advisories RLSA-2026:50773RLSA-2026:50778RLSA-2026:50827RLSA-2026:50828RLSA-2026:50728
- ruby Alpine 3.21 3.3.13-r0
- ruby Alpine 3.24, Alpine 3.23, Alpine 3.22 3.4.9-r0
alpine advisories ALPINE-CVE-2026-27820
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-27820 updated cvss 5.6
zlib: zlib: Memory corruption via buffer overflow in Zlib::GzipReader
-
Red Hat Enterprise Linux 6 ruby, ruby-ri, ruby-irb, ruby-libs, ruby-rdoc, ruby-tcltk Red Hat Enterprise Linux 7 ruby, ruby-irb, rubygems, ruby-libs, ruby-tcltk, rubygem-json, +6 more Red Hat Enterprise Linux 8 ruby, ruby-irb, rubygems, ruby-libs, rubygem-pg, rubygem-irb, +25 more Red Hat Enterprise Linux 9 ruby, rubygems, ruby-libs, rubygem-irb, rubygem-rbs, rubygem-rss, +13 moreaffected: workaround, no fix available “Fix deferred”
-
Red Hat Enterprise Linux AppStream (v. 8) ruby 3.3.12-8.module+el8.10.0+24567+c4e5368e, rubygems 3.5.22-8.module+el8.10.0+24567+c4e5368e, ruby-libs 3.3.12-8.module+el8.10.0+24567+c4e5368e, rubygem-pg 1.5.4-1.module+el8.10.0+21226+b78a28c4, rubygem-rbs 3.4.0-8.module+el8.10.0+24567+c4e5368e, rubygem-rss 0.3.1-8.module+el8.10.0+24567+c4e5368e, +18 morefixed: vendor fix RHSA-2026:50728
-
Red Hat Enterprise Linux AppStream (v. 9) ruby 3.3.12-8.module+el9.8.0+24568+2bbebe96, ruby 4.0.6-34.module+el9.8.0+24564+e55418dc, rubygems 3.5.22-8.module+el9.8.0+24568+2bbebe96, ruby-libs 3.3.12-8.module+el9.8.0+24568+2bbebe96, ruby-libs 4.0.6-34.module+el9.8.0+24564+e55418dc, rubygem-pg 1.5.4-2.module+el9.8.0+24356+77305e91, +40 morefixed: vendor fix RHSA-2026:50828
-
Red Hat Enterprise Linux AppStream (v. 10) ruby 3.3.12-14.el10_2, ruby4.0 4.0.6-36.el10_2, rubygems 3.5.22-14.el10_2, ruby-libs 3.3.12-14.el10_2, rubygem-rbs 3.4.0-14.el10_2, rubygem-rss 0.3.1-14.el10_2, +18 more Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) ruby-doc 3.3.12-14.el10_2, ruby4.0-doc 4.0.6-36.el10_2fixed: vendor fix RHSA-2026:50778
-
Red Hat Hardened Images ruby3.4 3.4.8-31.1.hum1, ruby4.0 4.0.0-33.3.hum1, ruby3.3 3.3.10-23.1.hum1, ruby3.4-libs 3.4.8-31.1.hum1, ruby4.0-libs 4.0.0-33.3.hum1, ruby3.3-libs 3.3.10-23.1.hum1, +6 morefixed: vendor fix RHSA-2026:7305
-
Red Hat Hardened Images rubygem3.3-rbs 3.4.0-23.1.hum1, rubygem3.3-rss 0.3.1-23.1.hum1, rubygem3.4-rbs 3.8.0-31.1.hum1, rubygem3.4-rss 0.3.1-31.1.hum1, rubygem4.0-rss 0.3.2-33.3.hum1, rubygem3.3-irb 1.13.1-23.1.hum1, +45 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 6 mo ago
Exploit prediction
0.56% chance of exploitation in the next 30 days, higher than 46% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 4.0 | 1.7 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U |
| CNA | 4.0 | 1.7 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | zlib | >=3.2.0, <3.2.3 >=3.1.0, <3.1.2 <3.0.1 |
3.2.3 3.1.2 3.0.1 |
Affected products
- ruby zlib
Classification
References
-
github.com
/ruby/zlib/security/advisories/GHSA-g857-hhfv-j68w
web, vendor-advisory
-
hackerone.com
/reports/3467067
web, permissions-required
-
nvd.nist.gov
/vuln/detail/CVE-2026-27820
advisory
-
github.com
/ruby/zlib
package
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/zlib/CVE-2026-27820.yml
web
-
ruby-lang.org
/en/news/2026/03/05/buffer-overflow-zlib-cve-2026-27820
web
Sources
- CVE List CVE-2026-27820
- GitHub Advisory GHSA-g857-hhfv-j68w
- NVD CVE-2026-27820
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.