GHSA-g857-hhfv-j68w

Suggest an improvement
Source
https://github.com/advisories/GHSA-g857-hhfv-j68w
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-g857-hhfv-j68w/GHSA-g857-hhfv-j68w.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-g857-hhfv-j68w
Aliases
Downstream
Related
Published
2026-04-16T20:40:54Z
Modified
2026-05-28T18:29:27.077898078Z
Severity
  • 5.9 (Medium) CVSS_V4 - CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U CVSS Calculator
Summary
Buffer Overflow in Zlib::GzipReader ungetc via large input leads to memory corruption
Details

Details

A buffer overflow vulnerability exists in 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.

Recommended action

We recommend to update the zlib gem to version 3.2.3 or later. In order to ensure compatibility with bundled version in older Ruby series, you may update as follows instead:

  • For Ruby 3.2 users: Update to zlib 3.0.1
  • For Ruby 3.3 users: Update to zlib 3.1.2

You can use gem update zlib to update it. If you are using bundler, please add gem "zlib", ">= 3.2.3" to your Gemfile.

Affected versions

zlib gem 3.2.2 or lower

Credits

calysteon

References

  • https://hackerone.com/reports/3467067
Database specific
{
    "github_reviewed": true,
    "nvd_published_at": "2026-04-16T18:16:44Z",
    "github_reviewed_at": "2026-04-16T20:40:54Z",
    "cwe_ids": [
        "CWE-120"
    ],
    "severity": "MODERATE"
}
References

Affected packages

RubyGems / zlib

Package

Name
zlib
Purl
pkg:gem/zlib

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.2.0
Fixed
3.2.3

Affected versions

3.*
3.2.0
3.2.1
3.2.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-g857-hhfv-j68w/GHSA-g857-hhfv-j68w.json"

RubyGems / zlib

Package

Name
zlib
Purl
pkg:gem/zlib

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.1.0
Fixed
3.1.2

Affected versions

3.*
3.1.0
3.1.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-g857-hhfv-j68w/GHSA-g857-hhfv-j68w.json"

RubyGems / zlib

Package

Name
zlib
Purl
pkg:gem/zlib

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.0.1

Affected versions

0.*
0.0.1
0.1.0
1.*
1.0.0
1.1.0
2.*
2.0.0
2.1.0
2.1.1
3.*
3.0.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-g857-hhfv-j68w/GHSA-g857-hhfv-j68w.json"