CVE-2025-9340

native encrypt/decrypt operations in JCE may corrupt data if same byte array used for input and output.

Published Aug 22, 2025 CVSS 4.0 · 0 Low EPSS < 1% KEV · Not listed
Description
Out-of-bounds Write vulnerability in Legion of the Bouncy Castle Inc. Bouncy Castle for Java bc-fips on All (API modules). This vulnerability is associated with program files org/bouncycastle/jcajce/provider/BaseCipher.

This issue affects Bouncy Castle for Java: from BC-FJA 2.1.0 through 2.1.0.

Remediation

Vendor Workaround

This can be coded around by avoiding operations in place when dealing with aes-native encryption/decryption.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2025-25505 Bouncy Castle for Java has Out-of-Bounds Write Vulnerability
Github GHSA Github GHSA GHSA-g6rx-6wfx-gj74 Bouncy Castle for Java has Out-of-Bounds Write Vulnerability
History
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Bouncycastle
Bouncycastle legion-of-the-bouncy-castle-fips-java-api
Vendors & Products Bouncycastle
Bouncycastle legion-of-the-bouncy-castle-fips-java-api
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Out-of-bounds Write vulnerability in Legion of the Bouncy Castle Inc. Bouncy Castle for Java bc-fips on All (API modules). This vulnerability is associated with program files org/bouncycastle/jcajce/provider/BaseCipher. This issue affects Bouncy Castle for Java: from BC-FJA 2.1.0 through 2.1.0.
Title native encrypt/decrypt operations in JCE may corrupt data if same byte array used for input and output.
Weaknesses CWE-787
References
Metrics cvssV4_0

{'score': 0, 'vector': 'CVSS:4.0/AV:P/AC:L/AT:P/PR:L/UI:A/VC:N/VI:N/VA:N/SC:N/SI:N/SA:N/S:N/R:U/RE:M/U:Green'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
bcorg
Published
Updated
Aug 22, 2025, 10:37 AM
Reserved
Aug 22, 2025, 8:45 AM
Status
Deferred
Published
Aug 22, 2025, 10:15 AM
Modified
Jun 17, 2026, 10:08 AM
Severity
Moderate
Public date
Aug 22, 2025, 9:39 AM