Advisory Database
  • Advisories
  • Dependency Scanning
  1. maven
  2. ›
  3. org.bouncycastle/bcmls-jdk18on
  4. ›
  5. CVE-2026-12852

CVE-2026-12852: MLS wire decoder allocates attacker-declared opaque length before bounds check

August 3, 2026 (updated September 16, 2026)

Affects Bouncy Castle for Java before 1.85. MLSInputStream.readOpaque() decodes a varint length of up to about 1 GiB and allocates a buffer of that size before confirming enough bytes remain. The call is reached on the first fields of unauthenticated wire structures, ahead of any signature or MAC check. A few bytes declaring a maximal length force a gigabyte allocation per message, and a handful of concurrent messages exhaust the heap.

References

  • github.com/bcgit/bc-java/commit/a747038bb5bbd5e29fb2b7607ab38af1fd8d1790
  • github.com/bcgit/bc-java/wiki/CVE-2026-12852
  • nvd.nist.gov/vuln/detail/CVE-2026-12852

Code Behaviors & Features

Detect and mitigate CVE-2026-12852 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.78.0 before 1.85.0

Fixed versions

  • 1.85.0

Solution

Upgrade to version 1.85.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-789: Memory Allocation with Excessive Size Value

Source file

maven/org.bouncycastle/bcmls-jdk18on/CVE-2026-12852.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 22 Sep 2026 12:20:23 +0000.