Loading...
Skip to main content

CVE-2026-27820 — Buffer Overflow in zlib — CVE Details

MEDIUM

Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption

Published April 16, 2026Updated September 10, 2026Source: osv

Summary

### Details A buffer overflow vulnerability exists in `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. ### Recommended action We recommend to update the `zlib` gem to version 3.2.3 or later. In order to ensure compatibility with bundled version in older Ruby series, you may update as follows instead: * For Ruby 3.2 users: Update to zlib 3.0.1 * For Ruby 3.3 users: Update to zlib 3.1.2 You can use gem update zlib to update it. If you are using bundler, please add `gem "zlib", ">= 3.2.3"` to your Gemfile. ### Affected versions zlib gem 3.2.2 or lower ### Credits [calysteon](https://hackerone.com/calysteon) ### References * https://hackerone.com/reports/3467067

Advisory Timeline

  • First published April 16, 2026 (179 days ago).
  • Last revised September 10, 2026 — 146 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update zlib to 3.2.3 or later
gem install zlib -v 3.2.3
Bundler
Update zlib to 3.0.1 or later
gem install zlib -v 3.0.1
Bundler
Update zlib to 3.1.2 or later
gem install zlib -v 3.1.2

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
zlib
rubygems
3.2.0, 3.2.1, 3.2.23.2.3
zlib
rubygems
0.0.1, 0.1.0, 1.0.0, 1.1.0 (+4 more)3.0.1
zlib
rubygems
3.1.0, 3.1.13.1.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-120
    Buffer Copy Without Checking SizeMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-27820?
Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2026-27820?
CVE-2026-27820 affects zlib. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-27820 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-g857-hhfv-j68w

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies