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-9341 Overview
CVE-2025-9341 is an Uncontrolled Resource Consumption vulnerability [CWE-400] in the Legion of the Bouncy Castle cryptography libraries for Java. The flaw resides in the native Advanced Encryption Standard Cipher Block Chaining (AES-CBC) implementations at org/bouncycastle/crypto/fips/AESNativeCBC.java and org/bouncycastle/crypto/engines/AESNativeCBC.java. Attackers with local access can trigger excessive memory allocation, degrading availability of the affected process. The issue affects Bouncy Castle for Java FIPS version 2.1.0 and Bouncy Castle for Java LTS versions 2.73.0 through 2.73.7.
Critical Impact
Excessive allocation in the native AES-CBC code paths can exhaust process memory and cause denial of service in applications relying on Bouncy Castle for cryptographic operations.
Affected Products
- Bouncy Castle for Java FIPS (bc-fips) version 2.1.0
- Bouncy Castle for Java LTS (bcprov-lts8on) versions 2.73.0 through 2.73.7
- Java applications invoking the native AES-CBC API modules
Discovery Timeline
- 2025-08-22 - CVE-2025-9341 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-9341
Vulnerability Analysis
The vulnerability is classified as Uncontrolled Resource Consumption [CWE-400]. It affects the native AES-CBC implementations shipped with Bouncy Castle for Java FIPS and the Java LTS provider. When input parameters passed to the AES-CBC primitives are not properly bounded, the library performs an excessive memory allocation on behalf of the caller. The result is memory exhaustion within the Java Virtual Machine (JVM) process that hosts the cryptographic workload.
Because Bouncy Castle is a widely embedded dependency, affected applications include TLS endpoints, signing services, message brokers, and any Java service that performs symmetric encryption through the Bouncy Castle provider. The attack vector is local, limiting exposure to callers that can supply crafted parameters to the cryptographic API.
Root Cause
The root cause is missing size validation on allocation requests inside the native AES-CBC code paths in AESNativeCBC.java. Both the FIPS module (bc-fips 2.1.0) and the LTS provider (bcprov-lts8on 2.73.0 through 2.73.7) share this defective allocation logic. The library trusts the caller-supplied dimensions and does not cap the amount of memory requested from the runtime.
Attack Vector
An attacker with the ability to invoke the Bouncy Castle AES-CBC API, directly or through an application that exposes cryptographic operations to local input, can submit values that force a large allocation. This triggers an OutOfMemoryError or process termination. Exploitation does not require authentication or user interaction, but access is limited to the local attack surface.
No verified proof-of-concept code is published. Refer to the GitHub BCJava CVE-2025-9341 Wiki for maintainer-authored technical details.
Detection Methods for CVE-2025-9341
Indicators of Compromise
- Repeated java.lang.OutOfMemoryError events originating from org.bouncycastle.crypto.fips.AESNativeCBC or org.bouncycastle.crypto.engines.AESNativeCBC stack frames.
- Sudden JVM heap or native memory spikes correlated with calls into the Bouncy Castle AES-CBC API.
- Unexpected restarts or crash loops of Java services that embed bc-fips 2.1.0 or bcprov-lts8on 2.73.0 through 2.73.7.
Detection Strategies
- Inventory Java applications and container images for the vulnerable bc-fips and bcprov-lts8on artifact versions using Software Composition Analysis.
- Instrument JVM metrics to alert on abnormal allocation rates and garbage collection pressure in cryptographic services.
- Correlate application exceptions with cryptographic request volume to identify abusive callers.
Monitoring Recommendations
- Enable JVM flight recording or heap dumps on OutOfMemoryError to capture the triggering stack trace.
- Forward JVM telemetry and application logs to a centralized analytics platform for anomaly detection.
- Track process memory, thread, and file descriptor counts for services that expose cryptographic endpoints.
How to Mitigate CVE-2025-9341
Immediate Actions Required
- Identify every deployment of bc-fips 2.1.0 and bcprov-lts8on versions 2.73.0 through 2.73.7 across build artifacts and runtime environments.
- Upgrade to a fixed Bouncy Castle release as published by the Legion of the Bouncy Castle project.
- Restrict local access to Java services that expose Bouncy Castle AES-CBC operations to untrusted callers.
Patch Information
The Legion of the Bouncy Castle project tracks the fix and remediation guidance on the GitHub BCJava CVE-2025-9341 Wiki. Apply the vendor-recommended version upgrade for both the FIPS module and the LTS provider.
Workarounds
- Where upgrading is not immediately feasible, configure applications to use an alternate JCE provider for AES-CBC until the patched Bouncy Castle version is deployed.
- Apply per-process memory limits using -Xmx and container cgroup constraints to contain the impact of excessive allocation.
- Validate and bound the size of attacker-influenced inputs before passing them to Bouncy Castle cryptographic primitives.
# Example Maven dependency check for vulnerable artifacts
mvn dependency:tree | grep -E "bc-fips:2\.1\.0|bcprov-lts8on:2\.73\.[0-7]"
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

