Skip to content
Heist/ feed
Back to feed
CriticalFix available

ruby — security advisory

Type: advisorySources: OSVAdvisory ID: ALPINE-CVE-2026-27820

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.

Products
ruby
Affected versions
Not specified
Fixed versions
3.3.13-r0, 3.4.9-r0
CVEs
CVE-2026-27820
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 17:49 UTC · Revision 2

Source evidence

ALPINE-CVE-2026-27820

core-osv · Original source

Published 16 Apr 2026, 18:16 UTC

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.

osv:ALPINE-CVE-2026-27820

ruby

Fixed versions: 3.3.13-r0

ruby

Fixed versions: 3.4.9-r0

ruby

Fixed versions: 3.4.9-r0

ruby

Fixed versions: 3.4.9-r0

Complete source record
{
  "id": "cca67bb0e4714f520b8e12839be3149b18169607e953f5740bc414d7c0afc4b6",
  "url": "https://osv.dev/vulnerability/ALPINE-CVE-2026-27820",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "ALPINE-CVE-2026-27820",
    "summary": "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.",
    "evidence": "osv:ALPINE-CVE-2026-27820",
    "products": [
      {
        "name": {
          "value": "ruby",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.3.13-r0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "ruby",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.4.9-r0",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "ruby",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.4.9-r0",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "ruby",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.4.9-r0",
            "evidence": "/affected/3/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "critical",
    "structured": {
      "id": "ALPINE-CVE-2026-27820",
      "aliases": [
        "ALPINE-CVE-2026-27820"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.3.13-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby",
            "purl": "pkg:apk/alpine/ruby?arch=source",
            "ecosystem": "Alpine:v3.21"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-27820.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.4.9-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby",
            "purl": "pkg:apk/alpine/ruby?arch=source",
            "ecosystem": "Alpine:v3.22"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-27820.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.4.9-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby",
            "purl": "pkg:apk/alpine/ruby?arch=source",
            "ecosystem": "Alpine:v3.23"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-27820.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.4.9-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby",
            "purl": "pkg:apk/alpine/ruby?arch=source",
            "ecosystem": "Alpine:v3.24"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-27820.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-27T12:30:04.770953135Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-27820"
      ],
      "references": [
        "https://security.alpinelinux.org/vuln/CVE-2026-27820"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-27820",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 461313,
  "published_at": "2026-04-16T18:16:44.77+00:00"
}