Memory Allocation with Excessive Size Value Affecting org.bouncycastle:bcmls-jdk18on package, versions [,1.85)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.26% (19th 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-ORGBOUNCYCASTLE-18519261
  • published5 Aug 2026
  • disclosed3 Aug 2026
  • creditUnknown

Introduced: 3 Aug 2026

NewCVE-2026-12852  (opens in a new tab)
CWE-789  (opens in a new tab)

How to fix?

Upgrade org.bouncycastle:bcmls-jdk18on to version 1.85 or higher.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the readOpaque() method of MLSInputStream, which decodes a varint length up to 0x3FFFFFFF (about 1 GiB) and calls readAll(size) performing new byte[size] before checking that enough bytes remain in the stream. An attacker can exhaust the JVM heap and crash the process by sending a ~6-byte MLS message whose first opaque length varint is 0xBFFFFFFF, forcing a ~1 GiB allocation per message. This requires only the ability to send raw MLS bytes to the application, since the allocation occurs before any signature or MAC verification.

CVSS Base Scores

version 4.0
version 3.1