Executive brief
Bouncy Castle is a widely used Java library for cryptography and certificate management. A vulnerability in its certificate path reviewer component allows an attacker to trigger excessive memory allocation by providing a specially crafted certificate with very large name constraints. This can lead to a denial-of-service (DoS) condition, potentially crashing the application or making it unresponsive.
Technical details
The vulnerability is classified as CWE-770 (Allocation of Resources Without Limits or Throttling). The PKIXCertPathReviewer class fails to enforce a size limit on Name Constraints objects within ASN.1 structures. An attacker can exploit this by submitting certificate paths containing maliciously large name constraints or Subject Alternative Name extensions. If the application processes these untrusted certificate paths without prior validation, the library will attempt to allocate excessive memory, resulting in a Denial of Service (DoS). The issue is fixed in Bouncy Castle Java 1.79 and BCPKIX FIPS 1.0.8 and 2.0.8 by implementing caps on the size of these extensions.
Affected products
- Legion of the Bouncy Castle Inc. Bouncy Castle for Java (bcpkix, bcprov) 1.44 through 1.78
- Legion of the Bouncy Castle Inc. BCPKIX FIPS (bcpkix-fips) 1.0.0 through 1.0.7, 2.0.0 through 2.0.7
Timeline
- 2025-08-13: advisory: Initial disclosure and GitHub Advisory publication
- 2025-08-13: patched: Fixes released in versions 1.79, 1.0.8, and 2.0.8