Memory Allocation with Excessive Size Value Affecting org.bouncycastle:bcpg-fips package, versions [,1.0.13)[2.0.0,2.0.13)[2.1.0,2.1.13)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.28% (20th 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-18512843
  • published4 Aug 2026
  • disclosed3 Aug 2026
  • creditUnknown

Introduced: 3 Aug 2026

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

How to fix?

Upgrade org.bouncycastle:bcpg-fips to version 1.0.13, 2.0.13, 2.1.13 or higher.

Overview

Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value in the readPacket() method of UserAttributeSubpacketInputStream, which reads a 5-octet subpacket length up to Integer.MAX_VALUE and allocates new byte[bodyLen-1] after checking only against a limit derived from JVM maximum memory rather than the enclosing packet body length. An attacker can exhaust memory and trigger an OutOfMemoryError by getting a victim to import an OpenPGP public key whose user-attribute subpacket declares a length approaching the full heap, so a small key forces a near-heap-sized allocation. This requires the victim to import the attacker's public key, for example from a keyserver, WKD, or email attachment, and reaches the flaw through the single-argument UserAttributePacket stream construction where the limit is not bounded by the actual packet body.

CVSS Base Scores

version 4.0
version 3.1