CVE-2026-87877: Use After Free in luben zstd-jni
Affects luben zstd-jniSource CVE Database V5
Not known to be exploited · CVSS 7.0 High · fixed in 1.5.7 : patch luben zstd-jni soon.
Data as of 10/24/2026, 22:16:05 UTC
- Exploitation
Not in CISA KEV, no exploitation reported
- EPSS
- 0.2% chance of exploitation in 30 days – higher than 9% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.5.7
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:NWhat to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| lubenzstd-jni | Affected
| Fixed in
|
Mavenluben/zstd-jnipkg:maven/luben/zstd-jniOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fixed version is available starting from 1.5.7-14. Users should upgrade to version 1.5.7-14 or later to remediate this vulnerability. No vendor advisory content was provided to indicate alternative mitigations or temporary fixes. Patch status is confirmed by the affected version range indicating fixed versions at 1.5.7-14 and later.
Description
CVE-2026-87877 is a use-after-free vulnerability in the luben zstd-jni library affecting versions from 1.3.8-4 up to but not including 1.5.7-14. The flaw arises because certain stream class methods do not validate the closed state before operating, allowing attackers to invoke these methods on closed streams. This can lead to writing through freed native pointers, potentially corrupting unrelated objects or causing the Java Virtual Machine (JVM) to crash. The vulnerability has a high severity score of 7.0 and does not currently have known exploits in the wild.
Impact
Successful exploitation can cause memory corruption or JVM crashes due to use-after-free conditions. This impacts the integrity and availability of applications using the affected zstd-jni versions. There is no indication of remote exploitation or privilege escalation. No known active exploits have been reported.
Summary
The vulnerability in zstd-jni versions >=1.3.8-4 and <1.5.7-14 involves failure to check if a stream is closed before executing methods such as setDict, setLongMax, setLevel, and setRefMultipleDDicts. This improper validation enables attackers to perform use-after-free operations by calling these methods on streams that have already been closed, resulting in writes through freed native pointers. The consequence can be memory corruption affecting unrelated objects or JVM crashes. The CVSS 4.0 score is 7.0 (high), with attack vector local, low attack complexity, no privileges or user interaction required, and high impact on integrity and availability.
References
- github.com/luben/zstd-jni/security/advisories/GHSA-2jw3-mg7f-vw4q (opens in a new tab)
- github.com/luben/zstd-jni/commit/f38f9a1563113d96d0fc38baee543f7457dd8a8e (opens in a new tab)
- github.com/luben/zstd-jni/commit/393d7311766abbc285b149302c0fe1f94b16d555 (opens in a new tab)
- github.com/luben/zstd-jni/blob/v1.5.7-13/src/main/java/com/github/luben/zstd/BaseZstdBufferDecompressingStreamNoFinalizer.java (opens in a new tab)
- github.com/luben/zstd-jni/blob/v1.5.7-13/src/main/java/com/github/luben/zstd/ZstdInputStreamNoFinalizer.java (opens in a new tab)
- github.com/luben/zstd-jni/releases/tag/v1.5.7-14 (opens in a new tab)
- github.com/luben/zstd-jni/commit/0827ed02551bbd8d6f8e4bbff99d83bf50f91938 (opens in a new tab)
- github.com/luben/zstd-jni (opens in a new tab)
- vulncheck.com/advisories/zstd-jni-1.3.8-4-through-1.5.7-13-use-after-free-via-setters-called-after-close (opens in a new tab)