CVE-2026-87877: zstd-jni use-after-free in stream setter methods

CVE-2026-87877 · Severity: high · CVSS 7.7 · Published 2026-09-09

zstd-jni is a Java library providing compression and decompression via JNI bindings to the Zstandard algorithm. Versions before 1.5.7-14 fail to validate whether stream objects have been closed before allowing setter methods to execute, allowing attackers to write through freed native memory pointers and corrupt other objects or crash the Java virtual machine.

Technologies: Luben Zstd-Jni. Vendors: Luben.

Quick answers

Is CVE-2026-87877 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-87877 being exploited in the wild.
How severe is CVE-2026-87877?
High severity, with a CVSS score of 7.7, published 9 September 2026.
Which products and versions are affected?
Luben Zstd-Jni before 1.5.7-14.
Is there a fix for CVE-2026-87877?
A patch was published on 2026-08-16: Fixed in version 1.5.7-14 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-87877 attacked?
It is attacked with local access.
Am I affected by CVE-2026-87877?
Check whether you run Luben Zstd-Jni at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is a use-after-free in stream classes resulting from missing closed-state validation. The affected methods—setDict, setLongMax, setLevel, and setRefMultipleDDicts—fail to check whether their parent stream object has been closed before dereferencing native pointers. An attacker with local JVM access can invoke these methods on a closed stream instance, causing writes through dangling pointers to freed native memory, leading to heap corruption, information disclosure, or denial of service (JVM crash). The vulnerability is fixed in zstd-jni 1.5.7-14 and later.

Affected products

  • Luben zstd-jni before 1.5.7-14

Timeline

  • 2026-09-09: disclosed
  • 2026-08-16: patched: Fixed in version 1.5.7-14

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.