ZeroHour

CVE-2026-87824

large

Out-of-bounds read in zstd-jni Zstd.trainFromBufferDirect crashes JVMs

CVSS 4.0
8.7 high
EPSS
<1%p32
Published
()
Modified
AI analysis

zstd-jni before 1.5.7-14 fails to validate the samples buffer capacity in the Zstd.trainFromBufferDirect dictionary-training method, producing an out-of-bounds read (CWE-125) in the native code. An attacker who can influence the sample data or the per-sample length array passed to this API can supply oversized sample lengths, causing the JNI implementation to walk past the end of the allocated buffer. The primary impact is availability: the out-of-bounds memory access can terminate the JVM, with no confidentiality or integrity impact indicated in the CVSS 4.0 score (VA:H, VC:N/VI:N). Any JVM application that invokes Zstd.trainFromBufferDirect on attacker-controlled or untrusted input is affected, which is a subset of the many projects that bundle zstd-jni for Zstandard compression. No public proof-of-concept, listing in CISA KEV, or known in-the-wild exploitation has been reported.

What to do: Upgrade zstd-jni to 1.5.7-14 or later wherever it is present. Audit dependency trees (e.g., mvn dependency:tree, gradle dependencies) for zstd-jni and identify whether application code calls Zstd.trainFromBufferDirect with external input; as an interim mitigation, clamp or validate sample lengths against the buffer size before training, or avoid running dictionary training on untrusted data. No workarounds or in-the-wild exploitation are documented, so patching can follow normal maintenance cycles unless the training API handles untrusted input.

Affected
luben (zstd-jni project, com.github.luben) zstd-jniall versions before 1.5.7-14
Estimated exposure
largetens of thousands of JVM deployments bundle zstd-jni (millions of monthly Maven Central downloads; bundled in Kafka/Spark/Hadoop-style data stacks), though… — zstd-jni is a very widely adopted Maven library with millions of downloads per month and transitive inclusion in major JVM data platforms, but the vulnerable dictionary-training API is rarely exposed to attacker-controlled input, so the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

zstd-jni before 1.5.7-14 fails to validate the samples buffer capacity in Zstd.trainFromBufferDirect, allowing attackers to read past buffer boundaries by supplying oversized per-sample lengths. Attackers can trigger out-of-bounds memory access by providing crafted sample length arrays that cause the native implementation to walk past the buffer allocation, resulting in JVM termination.

Weakness
CWE-125
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.