zlib: Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- —
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Partial Red Hat: 5 fixed, 4 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| ruby | zlib | before 3.0.1; 3.1.0 to before 3.1.2; 3.2.0 to before 3.2.3 | 3.0.1, 3.1.2, 3.2.3 | Patch available | CNA |
| — | zlib (RubyGems) | 3.2.0 to before 3.2.3 | 3.2.3 | Patch available | GHSA-g857-hhfv-j68w |
| — | zlib (RubyGems) | 3.1.0 to before 3.1.2 | 3.1.2 | Patch available | GHSA-g857-hhfv-j68w |
| — | zlib (RubyGems) | before 3.0.1 | 3.0.1 | Patch available | GHSA-g857-hhfv-j68w |
- zlib Vendorruby Affected before 3.0.1; 3.1.0 to before 3.1.2; 3.2.0 to before 3.2.3 Fixed in 3.0.1, 3.1.2, 3.2.3 Patch available CNA
- zlib (RubyGems) Vendor— Affected 3.2.0 to before 3.2.3 Fixed in 3.2.3 Patch available GHSA-g857-hhfv-j68w
- zlib (RubyGems) Vendor— Affected 3.1.0 to before 3.1.2 Fixed in 3.1.2 Patch available GHSA-g857-hhfv-j68w
- zlib (RubyGems) Vendor— Affected before 3.0.1 Fixed in 3.0.1 Patch available GHSA-g857-hhfv-j68w
Remediation
- Fix · CNA zlib (ruby) Fixed in 3.0.1, 3.1.2, 3.2.3
- Fix · GHSA-g857-hhfv-j68w zlib (RubyGems) Fixed in 3.2.3 Advisory →
- Fix · GHSA-g857-hhfv-j68w zlib (RubyGems) Fixed in 3.1.2 Advisory →
- Fix · GHSA-g857-hhfv-j68w zlib (RubyGems) Fixed in 3.0.1 Advisory →
Red Hat 8 advisories
- RHSA-2026:50827 Released 2026-08-05 · Red Hat rating Importantruby:4.0 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 9) ruby-4.0.6-34.module+el9.8.0+24564+e55418dc.aarch64::ruby:4.0, ruby-4.0.6-34.module+el9.8.0+24564+e55418dc.i686::ruby:4.0, ruby-4.0.6-34.module+el9.8.0+24564+e55418dc.ppc64le::ruby:4.0 +47
- RHSA-2026:50828 Released 2026-08-05 · Red Hat rating Importantruby:3.3 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 9) ruby-3.3.12-8.module+el9.8.0+24568+2bbebe96.aarch64::ruby:3.3, ruby-3.3.12-8.module+el9.8.0+24568+2bbebe96.i686::ruby:3.3, ruby-3.3.12-8.module+el9.8.0+24568+2bbebe96.ppc64le::ruby:3.3 +47
- RHSA-2026:50778 Released 2026-08-05 · Red Hat rating Importantruby security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 10) ruby-3.3.12-14.el10_2, ruby-bundled-gems-3.3.12-14.el10_2, ruby-default-gems-3.3.12-14.el10_2 +20
- Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) ruby-doc-3.3.12-14.el10_2
Show 5 more Red Hat advisories
- RHSA-2026:50773 Released 2026-08-05 · Red Hat rating Importantruby4.0 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 10) ruby4.0-4.0.6-36.el10_2, ruby4.0-devel-4.0.6-36.el10_2, ruby4.0-rubygem-mysql2-0.5.7-36.el10_2 +1
- Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) ruby4.0-doc-4.0.6-36.el10_2
- RHSA-2026:50728 Released 2026-08-05 · Red Hat rating Importantruby:3.3 security, bug fix, and enhancement update
- Red Hat Enterprise Linux AppStream (v. 8) ruby-3.3.12-8.module+el8.10.0+24567+c4e5368e.aarch64::ruby:3.3, ruby-3.3.12-8.module+el8.10.0+24567+c4e5368e.i686::ruby:3.3, ruby-3.3.12-8.module+el8.10.0+24567+c4e5368e.ppc64le::ruby:3.3 +47
- RHSA-2026:8838 Released 2026-04-17 · Red Hat rating ModerateRed Hat Hardened Images RPMs bug fix and enhancement update
- Red Hat Hardened Images ruby4.0-4.0.0-33.3.hum1@aarch64, ruby4.0-4.0.0-33.3.hum1@src, ruby4.0-4.0.0-33.3.hum1@x86_64 +10
- RHSA-2026:7307 Released 2026-04-09 · Red Hat rating ModerateRed Hat Hardened Images RPMs bug fix and enhancement update
- Red Hat Hardened Images ruby3.4-3.4.8-31.1.hum1@aarch64, ruby3.4-3.4.8-31.1.hum1@src, ruby3.4-3.4.8-31.1.hum1@x86_64 +10
- RHSA-2026:7305 Released 2026-04-09 · Red Hat rating ModerateRed Hat Hardened Images RPMs bug fix and enhancement update
- Red Hat Hardened Images ruby3.3-3.3.10-23.1.hum1@aarch64, ruby3.3-3.3.10-23.1.hum1@src, ruby3.3-3.3.10-23.1.hum1@x86_64 +10
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 7 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 8 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 9 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux AppStream (v. 10) | Fixed | RHSA-2026:50773, RHSA-2026:50778 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2026:50728 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2026:50827, RHSA-2026:50828 |
| Red Hat Enterprise Linux CodeReady Linux Builder (v. 10) | Fixed | RHSA-2026:50773, RHSA-2026:50778 |
| Red Hat Hardened Images | Fixed | RHSA-2026:7305, RHSA-2026:7307, RHSA-2026:8838 |
Not affected: 1 product
- Red Hat Hardened Images
Timeline
- 2026-10-02 Threatist record created from CVE-2026-27820
- 2026-10-03 Alias added: GHSA-g857-hhfv-j68w
- 2026-10-25 EPSS moved to the below the 50th percentile
- 2026-11-06 Affected versions changed · Red Hat
References
Advisory 2
Sources
- CVE-2026-27820 · CVE Program
- CVE-2026-27820 · NVD
- FIRST EPSS
- GHSA-g857-hhfv-j68w · GitHub Advisory Database · CC BY 4.0
- CVE-2026-27820 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences