CVE-2026-27820

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

Published Apr 16, 2026 CVSS 4.0 · 1.7 Low EPSS < 1% KEV · Not listed
Description
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4716-1 ruby2.7 security update
Github GHSA Github GHSA GHSA-g857-hhfv-j68w Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption
Ubuntu USN Ubuntu USN USN-8556-1 Ruby vulnerabilities
History
Type Values Removed Values Added
First Time appeared Ruby-lang
Ruby-lang zlib
CPEs cpe:2.3:a:ruby-lang:zlib:*:*:*:*:*:ruby:*:*
Vendors & Products Ruby-lang
Ruby-lang zlib
Metrics cvssV3_1

{'score': 5.6, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L'}

cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Ruby
Ruby zlib
Vendors & Products Ruby
Ruby zlib
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.6, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title zlib: Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption
Weaknesses CWE-120
CWE-131
References
Metrics cvssV4_0

{'score': 1.7, 'vector': '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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 16, 2026, 6:20 PM
Reserved
Feb 24, 2026, 2:32 AM
Status
Analyzed
Published
Apr 16, 2026, 6:16 PM
Modified
Oct 26, 2026, 9:10 PM
Severity
Moderate
Public date
Apr 16, 2026, 5:27 PM