Use After Free Affecting com.github.luben:zstd-jni package, versions [1.3.8-4,1.5.7-14)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.2% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-COMGITHUBLUBEN-19659617
  • published10 Sept 2026
  • disclosed9 Sept 2026
  • creditYu Bao

Introduced: 9 Sep 2026

NewCVE-2026-87877  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade com.github.luben:zstd-jni to version 1.5.7-14 or higher.

Overview

Affected versions of this package are vulnerable to Use After Free in the setDict, setLongMax, setLevel, and setRefMultipleDDicts methods of its streaming classes. An attacker can corrupt native heap state or crash the JVM by calling these setters on a stream after close(), causing them to write through a freed native context handle. The vulnerable code lives in BaseZstdBufferDecompressingStreamNoFinalizer, ZstdInputStreamNoFinalizer, and ZstdOutputStreamNoFinalizer, where these post-close setters still pass the stale native pointer into zstd's dictionary and parameter-loading routines. In applications that reuse or retain stream objects across lifecycle boundaries, the resulting write can alter an unrelated live native object or trigger a JVM crash.

CVSS Base Scores

version 4.0
version 3.1