CVE-2026-27820
Analyzed
Analyzed - Analysis Complete
Buffer Overflow in zlib Ruby GzipReader Causes Memory Corruption
Publication date: 2026-04-16
Last updated on: 2026-05-21
Assigner: GitHub, Inc.
Description
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.
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| ruby-lang | zlib | to 3.0.1 (exc) |
| ruby-lang | zlib | From 3.1.0 (inc) to 3.1.2 (exc) |
| ruby-lang | zlib | From 3.2.0 (inc) to 3.2.3 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-120 | The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. |
| CWE-131 | The product does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow. |