Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-12194 Overview
CVE-2025-12194 is an Uncontrolled Resource Consumption vulnerability [CWE-400] affecting Legion of the Bouncy Castle Inc.'s Bouncy Castle for Java FIPS (bc-fips) and Bouncy Castle for Java LTS (bcprov-lts8on). The flaw allows Excessive Allocation within native cryptographic API modules, including AES cipher modes (CBC, CFB, CTR, GCM, GCM-SIV, CCM) and SHA digest implementations. An attacker with local access can trigger memory exhaustion against applications that use these cryptographic primitives, leading to availability impact.
Critical Impact
Local attackers can cause excessive memory allocation in Bouncy Castle native AES and SHA implementations, degrading or disrupting availability of Java applications relying on these FIPS or LTS cryptographic APIs.
Affected Products
- Bouncy Castle for Java FIPS (bc-fips) versions 2.1.0 through 2.1.1
- Bouncy Castle for Java LTS (bcprov-lts8on) versions 2.73.0 through 2.73.7
- JDK 1.9+ native crypto API modules (AES and SHA families)
Discovery Timeline
- 2025-10-24 - CVE-2025-12194 published to NVD
- 2026-10-18 - Last updated in NVD database
Technical Details for CVE-2025-12194
Vulnerability Analysis
The vulnerability resides in the JDK 1.9 native crypto implementations within Bouncy Castle. Affected files include AESNativeCBC.java, AESNativeCFB.java, AESNativeCTR.java, AESNativeGCM.java, AESNativeGCMSIV.java, AESNativeCCM.java, AESNativeEngine.java, and native SHA digests (SHA224NativeDigest.java, SHA256NativeDigest.java, SHA384NativeDigest.java, SHA512NativeDigest.java, SHA3NativeDigest.java, SHAKENativeDigest.java). These classes accept size or length parameters that are not sufficiently bounded before memory allocation.
When an application passes attacker-influenced size values to the affected cipher or digest routines, the library allocates buffers proportional to those values. This behavior produces excessive memory consumption and can exhaust the JVM heap or native memory, resulting in denial of service.
Root Cause
The root cause is missing or insufficient validation of input size parameters prior to buffer allocation inside the native AES and SHA modules. The code trusts caller-supplied sizing information instead of enforcing upper bounds consistent with cryptographic operation requirements.
Attack Vector
Exploitation requires local access and user interaction at the application layer that forwards attacker-controlled parameters into the vulnerable crypto APIs. A low-privilege actor who can submit input processed by bc-fips or bcprov-lts8on cryptographic routines can trigger excessive allocations and degrade the hosting Java process. See the Bouncy Castle advisory for CVE-2025-12194 for upstream technical detail.
Detection Methods for CVE-2025-12194
Indicators of Compromise
- Java processes exhibiting sudden heap or native memory growth tied to cryptographic operations
- java.lang.OutOfMemoryError entries in application logs referencing Bouncy Castle native AES or SHA classes
- Repeated crashes or restarts of JVM services that load bc-fips 2.1.0–2.1.1 or bcprov-lts8on 2.73.0–2.73.7
Detection Strategies
- Inventory Java application dependencies using Software Composition Analysis (SCA) to flag affected Bouncy Castle versions
- Enable JVM memory telemetry (JFR, GC logs, native memory tracking) to detect anomalous allocation patterns in cryptographic call paths
- Correlate application exceptions referencing org.bouncycastle.crypto.fips.AESNative* or org.bouncycastle.crypto.digests.*NativeDigest with resource spikes
Monitoring Recommendations
- Alert on recurring OutOfMemoryError or container OOMKill events for services that embed Bouncy Castle
- Monitor process-level RSS, heap commit, and GC pause duration on hosts running affected JVMs
- Track dependency drift in build pipelines to ensure patched Bouncy Castle versions remain in use
How to Mitigate CVE-2025-12194
Immediate Actions Required
- Identify all applications bundling bc-fips 2.1.0–2.1.1 or bcprov-lts8on 2.73.0–2.73.7 and prioritize upgrade
- Restrict local access to services that process untrusted input through Bouncy Castle crypto APIs
- Enforce input size validation at application boundaries before passing data to AES or SHA routines
Patch Information
Refer to the official Bouncy Castle wiki entry for CVE-2025-12194 for fixed releases and upgrade guidance. Update bc-fips beyond 2.1.1 and bcprov-lts8on beyond 2.73.7 once vendor-supplied patched versions are available.
Workarounds
- Impose JVM memory limits (-Xmx, container memory limits) to contain blast radius of excessive allocation
- Add application-level length checks on data passed to AES cipher modes and SHA digests
- Disable or avoid the native crypto paths where feasible by configuring Bouncy Castle to use pure-Java providers
# Configuration example: Maven dependency pin to a patched release
# Replace <PATCHED_VERSION> with the vendor-published fixed version
mvn dependency:tree | grep -E "bc-fips|bcprov-lts8on"
# Example pin in pom.xml
# <dependency>
# <groupId>org.bouncycastle</groupId>
# <artifactId>bc-fips</artifactId>
# <version><PATCHED_VERSION></version>
# </dependency>
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

