CVE Database›Document archive›CVE-2026-89045

CVE-2026-89045

com.github.luben/zstd-jni: zstd-jni: Denial of Service via negative length parameter

Loading…

Severity

Moderate

Red Hat Product Security

4

CVSS 3.1

Review impact separately from score.

Published · September 11, 2026

Updated · October 10, 2026

Description

A flaw was found in zstd-jni. This vulnerability allows an attacker to trigger an infinite loop by providing negative length parameters to the ZstdInputStreamNoFinalizer.read() method. This can cause the read method to spin indefinitely, holding the stream monitor and blocking other threads from accessing the stream, ultimately leading to a Denial of Service (DoS) for the affected application.

Statement

Red Hat rates this Moderate, consistent with upstream's own CVSS 3.1 score of 4.0, for the same reason: the negative length has to come from the calling application's own logic, not from an attacker-controlled value received directly over a wire protocol.

Only the three-argument ZstdInputStreamNoFinalizer.read(byte[], int, int) overload is reachable this way; the caller has to already have a defect in its own length calculation, a bad remaining-bytes count for example, to hand zstd-jni a negative value in the first place, since InputStream's single-argument read() and read(byte[]) never produce one.

Where it is reachable, the failure is a single thread spinning and holding one stream instance's lock indefinitely, not memory corruption, data exposure, or privilege escalation, and it doesn't propagate to stream instances the hung caller isn't sharing. That combination, a caller-side prerequisite plus an impact bounded to one thread and one stream object, is why this stays Moderate rather than Important despite being a straightforward-looking DoS trigger on paper.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

If your integration calls read(byte[], int, int) directly with a computed length, for example a remaining-bytes calculation, add a len >= 0 check before the call. If you can't change the call site, avoid sharing a single ZstdInputStreamNoFinalizer instance across threads or requests, so a bad input only stalls the one caller that triggered it instead of every other caller waiting on the same stream.

CVSS / CWE

CVSS 3.1 · 4
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

CWE-835 · Loop with Unreachable Exit Condition ('Infinite Loop')