Cryptographic output corruption via overlapping buffers
Published Aug 22, 2025 · Updated Aug 22, 2025
Out-of-bounds write in Bouncy Castle for Java BC-FJA 2.1.0 allows attackers to produce corrupted ciphertext or plaintext. The BaseCipher implementation of Cipher.doFinal overwrites unread input when one byte array supplies both input and offset output. The condition requires in-place native AES encryption or decryption with different input and output offsets, and its bounded consequence is garbage cryptographic output.
Summary
What happened
Out-of-bounds write in Bouncy Castle for Java BC-FJA 2.1.0 allows attackers to produce corrupted ciphertext or plaintext. The BaseCipher implementation of Cipher.doFinal overwrites unread input when one byte array supplies both input and offset output. The condition requires in-place native AES encryption or decryption with different input and output offsets, and its bounded consequence is garbage cryptographic output.
The record
- CVE
- CVE-2025-9340
- Published
- Aug 22, 2025
- Updated
- Aug 22, 2025
- Vendor
- Legion of the Bouncy Castle Inc.
- Product
- Bouncy Castle for Java
- Classifications
- CWE-787, T1565
- Attack vector
- physical
- Privileges
- authenticated
Timeline
How it unfolded
- Aug 22, 2025CVE publishedPublication date reported by the CVE source.
- Aug 22, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=BC-FJA 2.1.0 <=2.1.0
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Public exploit references
No public exploit references are available in this record.
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo