Skip to main content

Ruby zlib gem CVE-2026-27820

| EUVDEUVD-2026-23278 LOW
Classic Buffer Overflow (CWE-120)
2026-04-16 GitHub_M GHSA-g857-hhfv-j68w
1.7
CVSS 4.0 · GitHub Advisory

Severity by source

GitHub Advisory PRIMARY
1.7 LOW
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
vuln.today AI
3.7 LOW

Network-reachable via gzip input (AV:N), but heap-state precondition required for overflow (AC:H); no auth needed (PR:N); impact limited to availability (A:L) per all scoring sources.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

7
Source Code Evidence Fetched
Jul 24, 2026 - 07:32 vuln.today
Analysis Generated
Jul 24, 2026 - 07:32 vuln.today
Patch released
Apr 17, 2026 - 15:38 nvd
Patch available
Patch available
Apr 16, 2026 - 19:16 EUVD
CVSS changed
Apr 16, 2026 - 18:22 NVD
1.7 (LOW)
EUVD ID Assigned
Apr 16, 2026 - 18:00 euvd
EUVD-2026-23278
CVE Published
Apr 16, 2026 - 17:27 nvd
LOW 1.7

DescriptionGitHub Advisory

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.

AnalysisAI

Buffer overflow in the Ruby zlib gem's Zlib::GzipReader allows remote or local attackers supplying crafted gzip data to corrupt process memory via the zstream_buffer_ungets function. Affected versions span all 3.0.x releases through 3.0.0, the 3.1.0-3.1.1 range, and 3.2.0-3.2.1, collectively covering a wide install base across Ruby 3.2 and 3.3 runtime environments. The vulnerability carries an EPSS of 0.04% (13th percentile) and is not listed in CISA KEV, indicating low current exploitation probability despite the memory-corruption class of the flaw.

Technical ContextAI

The Ruby zlib gem (rubygems/zlib, CPE cpe:2.3:a:ruby:zlib:*:*:*:*:*:*:*:*) wraps the native zlib C library to expose gzip read/write functionality to Ruby programs. The root cause is CWE-120 (Buffer Copy without Checking Size of Input): the C-level zstream_buffer_ungets function prepends caller-supplied bytes ahead of previously buffered output by using memmove to shift existing data rightward in the backing Ruby String object. It performs this memmove without first verifying that the String's allocated capacity can accommodate the additional bytes. When the combined length of prepended plus existing data exceeds capacity, the memmove writes out-of-bounds, corrupting adjacent heap memory. The defect is triggered through GzipReader#ungetc or related unget paths that invoke zstream_buffer_ungets with attacker-influenced input lengths.

RemediationAI

The primary fix is to upgrade the zlib gem to a patched release: Ruby 3.2 users should upgrade to zlib 3.0.1; Ruby 3.3 users should upgrade to zlib 3.1.2; Ruby 3.4 and later users should upgrade to zlib 3.2.3 or higher. Running gem update zlib will pull the latest compatible release. For Bundler-managed projects, add gem "zlib", ">= 3.2.3" (or the appropriate minimum for the series in use) to the Gemfile and run bundle update zlib. Ubuntu users on affected LTS releases should apply the packages from USN-8556-1. If an immediate upgrade is not feasible, the most effective compensating control is to ensure that application code does not call GzipReader#ungetc or equivalent unget paths with externally controlled input lengths, effectively removing the trigger path at the application layer - though this may break legitimate decompression workflows. No generic workaround eliminates the underlying unsafe memmove in the gem itself.

More in Ruby

View all
CVE-2017-17405 HIGH POC
8.8 Dec 15

Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl

CVE-2017-17790 CRITICAL POC
9.8 Dec 20

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio

CVE-2017-14064 CRITICAL POC
9.8 Aug 31

Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call

CVE-2016-2336 CRITICAL POC
9.8 Jan 06

Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi

CVE-2016-2337 CRITICAL POC
9.8 Jan 06

Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2016-2339 CRITICAL POC
9.8 Jan 06

An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub

CVE-2017-9225 CRITICAL POC
9.8 May 24

An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7

CVE-2026-27614 CRITICAL POC
9.3 Feb 25

Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th

CVE-2017-0898 CRITICAL POC
9.1 Sep 15

Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w

CVE-2013-4164 MEDIUM POC
6.8 Nov 23

Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru

CVE-2026-71847 HIGH POC
8.7 Aug 07

Heap-use-after-free in the Ruby json gem's native C extension (versions 2.20.0 through 2.21.1) allows an unauthenticated

CVE-2026-46727 HIGH POC
8.1 May 22

Use-after-free in Ruby 4.x (before 4.0.5) lets remote attackers who can manipulate DNS response timing crash application

Share

CVE-2026-27820 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy