Skip to main content

Bouncy Castle Java CVE-2026-12852

| EUVDEUVD-2026-52137 HIGH
Memory Allocation with Excessive Size Value (CWE-789)
2026-08-03 bcorg GHSA-p2mp-577q-8vh2
8.7
CVSS 4.0 · Vendor: bcorg
Share

Severity by source

Vendor (bcorg) PRIMARY
8.7 HIGH
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:Amber
vuln.today AI
7.5 HIGH

Network-reachable with no auth on unauthenticated MLS structures; availability-only impact via heap exhaustion; no scope change or confidentiality impact evidenced.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE
7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat
7.5 HIGH
qualitative

Primary rating from Vendor (bcorg).

CVSS VectorVendor: bcorg

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

3
Source Code Evidence Fetched
Aug 03, 2026 - 04:23 vuln.today
Analysis Generated
Aug 03, 2026 - 04:23 vuln.today
CVE Published
Aug 03, 2026 - 02:55 cve.org
HIGH 8.7

DescriptionCVE.org

In Bouncy Castle for Java before 1.85, MLS wire decoder allocates attacker-declared opaque length before bounds check.

AnalysisAI

Heap exhaustion via uncontrolled memory allocation in Bouncy Castle for Java's MLS wire decoder allows remote unauthenticated attackers to crash any application using the bc-java MLS module. The MLSInputStream.readOpaque() method decodes an attacker-supplied Varint length field (up to 0x3FFFFFFF, approximately 1 GiB) and allocates that buffer before verifying the input stream actually contains that many bytes; a handful of concurrent few-byte crafted messages can exhaust the JVM heap. No public exploit has been identified at time of analysis and CISA KEV listing is absent, though the attack is trivially constructable from the published patch and regression test.

Technical ContextAI

The vulnerability is in the MLS (RFC 9420, Messaging Layer Security) wire format decoder within the mls submodule of bc-java (CPE: cpe:2.3:a:legion_of_the_bouncy_castle_inc.:bc-java:*). MLS wire messages encode variable-length opaque fields using a Varint prefix. Before the fix, MLSInputStream.readOpaque() decoded the Varint length and immediately invoked new byte[size] without first checking that the stream contained at least that many remaining bytes. CWE-789 (Uncontrolled Memory Allocation) precisely describes this flaw: attacker-controlled data flows directly into an allocation call without an upper-bound constraint derived from actual input size. Critically, the affected message types - PublicMessage, KeyPackage, Welcome, and PrivateMessage - carry opaque fields in their opening bytes and are processed entirely before any signature or MAC verification, meaning the allocation path is reachable by any unauthenticated network peer.

RemediationAI

Upgrade Bouncy Castle for Java to version 1.85 or later, which incorporates the bounds check that validates the declared opaque length against the bytes actually remaining in the input stream before any buffer allocation (patch commit: https://github.com/bcgit/bc-java/commit/a747038bb5bbd5e29fb2b7607ab38af1fd8d1790). The vendor advisory is at https://github.com/bcgit/bc-java/wiki/CVE-2026-12852. If an immediate upgrade is not feasible, apply network-layer rate limiting and enforce a strict maximum inbound message size before bytes reach the MLS decoder, which prevents the large Varint value from being presented to the vulnerable code path; note this requires a proxy or application-level size gate and cannot be implemented via JVM flags alone. Setting a JVM heap ceiling (-Xmx) will not prevent the DoS but will reduce time-to-OOM and may improve process restart behaviour. Applications not using the bc-java MLS module require no remediation.

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

Vendor StatusVendor

SUSE

Severity: Important
Product Status
openSUSE Leap 16.0 Fixed
openSUSE Tumbleweed Fixed
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Affected

Share

CVE-2026-12852 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy