---
id: "CVE-2026-108106"
kind: "vulnerability"
aliases: ["CVE-2026-108106", "GHSA-q233-g92q-qxp6"]
title: "snappy-java: Unbounded memory allocation from attacker-declared uncompressed lengtha"
severity: "high"
cvss: 8.7
epss: 0.00371
exploited: false
status: "open"
category: "package"
products: [{"name": "org.xerial.snappy:snappy-java", "fixed": ["1.1.10.9"], "affected": "<= 1.1.10.8", "ecosystem": "maven"}]
ecosystems: ["maven"]
tags: ["cwe-770", "cwe-789", "internet-facing", "java", "maven", "package", "snappy-java"]
not_affected_if: ["patched-version", "trusted-input-only"]
published_at: "2026-10-09T15:17:11+00:00"
first_seen_at: "2026-10-27T15:34:04+00:00"
updated_at: "2026-10-27T16:03:35+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-q233-g92q-qxp6", "first_seen_at": "2026-10-27T15:34:04+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-108106", "first_seen_at": "2026-10-27T16:03:35+00:00"}]
---

# snappy-java: Unbounded memory allocation from attacker-declared uncompressed lengtha

snappy-java allocates an output buffer sized by the uncompressed length declared in the first bytes of its input, before checking the data. A few bytes of crafted compressed input can force a near 2 GB allocation, causing an OutOfMemoryError or NegativeArraySizeException and a denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- maven:org.xerial.snappy:snappy-java affected <= 1.1.10.8 fixed 1.1.10.9

## How to check

- Run `mvn dependency:tree | grep snappy-java` in the project and read the resolved version.
- Check whether the application decompresses untrusted input with `Snappy.uncompress`, `Snappy.uncompressString`, `SnappyInputStream` or `SnappyFramedInputStream`.

## Fix

- Upgrade `org.xerial.snappy:snappy-java` to `1.1.10.9` or later.
- Until upgraded, call `Snappy.uncompressedLength(input)` and reject input whose declared length exceeds an application-specific limit before decompressing.

## Timeline

- 2026-10-27T15:34:04+00:00 ghsa https://github.com/advisories/GHSA-q233-g92q-qxp6
- 2026-10-27T16:03:35+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-108106

## From the sources

### Impact
Several decompression paths in snappy-java allocate an output buffer sized by the uncompressed length declared in the first bytes of the compressed data, before decompressing or validating it. A few bytes of crafted input can therefore force an allocation of up to 2 GB, causing `OutOfMemoryError` (denial of service), or a `NegativeArraySizeException` for declared lengths of 2^31 or more.

Affected entry points include `Snappy.uncompress(byte[])`, `Snappy.uncompressString`, the `Snappy.uncompress*Array` methods, `SnappyInputStream`, and `SnappyFramedInputStream`. The `maxChunkSize` limit added for CVE-2023-43642 bounds only the compressed chunk length, so it does not prevent this.

### Patches
Fixed in 1.1.10.9 (#739). `Snappy.uncompressedLength()` now rejects negative declared lengths, and lengths larger than any valid Snappy stream of the given size can produce. The densest Snappy element expands 3 bytes to 64, so the limit is 64/3 of the compressed size. Allocations are therefore proportional to the input actually received.

### Workarounds
Before decompressing untrusted data, check that `Snappy.uncompressedLength(input)` is within an application-specific limit.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
