Quick answers
- Is CVE-2026-27820 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-27820 being exploited in the wild.
- How severe is CVE-2026-27820?
- Critical severity, with a CVSS score of 9.8, published 16 April 2026.
- Which products and versions are affected?
- zlib (RubyGems) ECOSYSTEM:introduced=3.2.0,fixed=3.2.3.
- Is there a fix for CVE-2026-27820?
- Yes. zlib (RubyGems): upgrade to 3.2.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-27820 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2026-27820?
- Check whether you run zlib (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- zlib (RubyGems): upgrade to 3.2.3 or later
bundle update zlib
Technical details
A classic buffer overflow (CWE-120) exists in the `zstream_buffer_ungets` function within `Zlib::GzipReader`. The vulnerability occurs because the function prepends caller-provided bytes to previously produced output without verifying that the underlying Ruby string buffer has sufficient capacity. When the buffer length exceeds its capacity during a `memmove` operation, memory corruption occurs. This can be triggered by providing large inputs to the `ungetc` method. The flaw allows for potential remote code execution or denial of service. Patches are available in versions 3.0.1, 3.1.2, and 3.2.3.
Affected products
- Ruby zlib < 3.0.1, >= 3.1.0, < 3.1.2, >= 3.2.0, < 3.2.3
Identifiers
- CVE-2026-27820
- GHSA-g857-hhfv-j68w
Timeline
- 2026-03-05: disclosed: Initial publication by Ruby-lang
- 2026-04-16: advisory: GitHub and NVD advisory published
References
- https://github.com/ruby/zlib/security/advisories/GHSA-g857-hhfv-j68w
- https://hackerone.com/reports/3467067
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/zlib/CVE-2026-27820.yml
- https://www.ruby-lang.org/en/news/2026/03/05/buffer-overflow-zlib-cve-2026-27820
- https://api.github.com/repos/ruby/zlib/security-advisories/GHSA-g857-hhfv-j68w