{"id":"CVE-2026-27820","published":"2026-04-16T17:27:48Z","modified":"2026-04-16T18:20:21Z","title":"zlib: Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption","vendor":"ruby","product":"zlib","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":1.7,"severity":"LOW","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00781,"percentile":0.5242,"provenance":"source"},"cwes":[{"id":"CWE-120","name":"Buffer Copy without Checking Size of Input"},{"id":"CWE-131","name":"Incorrect Calculation of Buffer Size"}],"references":[{"url":"https://github.com/ruby/zlib/security/advisories/GHSA-g857-hhfv-j68w","tags":["x_refsource_CONFIRM"]},{"url":"https://hackerone.com/reports/3467067","tags":["x_refsource_MISC"]}],"priority":{"score":11.7,"factors":[{"name":"EPSS percentile","points":10.48},{"name":"CVSS severity","points":1.19}]},"vendorSlug":"ruby","affectedVersions":[{"vendor":"ruby","product":"zlib","versions":["< 3.0.1",">= 3.1.0, < 3.1.2",">= 3.2.0, < 3.2.3"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-04-16T18:20:13.051389Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"zlib","vulnerableRanges":[">=3.2.0, <3.2.3",">=3.1.0, <3.1.2","<3.0.1"],"patched":["3.2.3","3.1.2","3.0.1"],"from":["GHSA-g857-hhfv-j68w"],"provenance":"source"}],"summary":{"text":"The zlib Ruby extension's Zlib::GzipReader contains a buffer overflow in its zstream_buffer_ungets function, which prepends caller-provided bytes before previously produced output without ensuring the backing Ruby string has enough capacity before shifting existing data. An attacker able to reach the affected code path over the network, without authentication, and with a limited attack complexity can trigger memory corruption by supplying input that makes the buffer length exceed its capacity, with the impact limited to availability.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:07:33Z"},"euvd":{"id":"EUVD-2026-23278","exploited":false,"provenance":"source"}}