CVE-2026-18040: CWE-208 Observable Timing Discrepancy in Legion of the Bouncy Castle Inc. BC-JAVA
CVE-2026-18040 is a medium severity vulnerability in Bouncy Castle for Java versions 1.73 up to but not including 1.86. It involves observable timing and cache side channels in the HQC cryptographic implementation, which leak secret-derived data during encapsulation and decapsulation. The flaw arises from lookup tables used in GF(2^8) arithmetic and a fixed-weight support sampler that reveals secret indices through timing differences. These side channels can allow an attacker with the ability to observe cache behavior or timing to gain information about the private key. The vulnerability has been addressed by removing table lookups and making the sampler branch-free, preserving output and randomness consumption.
AI Analysis
Technical Summary
In Bouncy Castle for Java versions >=1.73 and <1.86, the HQC cryptographic scheme leaks secret-derived data via two side channels: (1) GF(2^8) arithmetic uses lookup tables indexed by secret field elements, causing cache line access patterns dependent on secret data; (2) the fixed-weight support sampler exits its duplicate scan early upon collision and stores accepted positions at secret indices, causing timing discrepancies. Both operations run on secret inputs during encapsulation and decapsulation, with the sampler re-expanding the secret key from its seed on every decapsulation. An attacker able to observe cache behavior or decapsulation timing can thus recover information about the HQC private key. The fix replaces table-based arithmetic with table-free methods and makes the sampler branch-free within candidate batches, eliminating these side channels without changing output or randomness consumption.
Potential Impact
The vulnerability allows attackers who can observe cache behavior or timing during cryptographic operations to recover partial information about the HQC private key. This leakage compromises the confidentiality of the private key, potentially weakening the security guarantees of the cryptographic scheme. However, exploitation requires local observation capabilities (local vector attack) and high attack complexity, reflected in the medium CVSS score of 5.9.
Mitigation Recommendations
A fixed version of Bouncy Castle for Java is available starting from version 1.86, which removes the vulnerable table lookups and timing branches. Users should upgrade to version 1.86 or later to mitigate this vulnerability. No additional mitigation is required once upgraded. Since this is not a cloud service, remediation depends on user upgrade.
CVE-2026-18040: CWE-208 Observable Timing Discrepancy in Legion of the Bouncy Castle Inc. BC-JAVA
Description
CVE-2026-18040 is a medium severity vulnerability in Bouncy Castle for Java versions 1.73 up to but not including 1.86. It involves observable timing and cache side channels in the HQC cryptographic implementation, which leak secret-derived data during encapsulation and decapsulation. The flaw arises from lookup tables used in GF(2^8) arithmetic and a fixed-weight support sampler that reveals secret indices through timing differences. These side channels can allow an attacker with the ability to observe cache behavior or timing to gain information about the private key. The vulnerability has been addressed by removing table lookups and making the sampler branch-free, preserving output and randomness consumption.
CVSS v4.0
Score 5.9medium
Affected software
Legion of the Bouncy Castle Inc.
BC-JAVA
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
In Bouncy Castle for Java versions >=1.73 and <1.86, the HQC cryptographic scheme leaks secret-derived data via two side channels: (1) GF(2^8) arithmetic uses lookup tables indexed by secret field elements, causing cache line access patterns dependent on secret data; (2) the fixed-weight support sampler exits its duplicate scan early upon collision and stores accepted positions at secret indices, causing timing discrepancies. Both operations run on secret inputs during encapsulation and decapsulation, with the sampler re-expanding the secret key from its seed on every decapsulation. An attacker able to observe cache behavior or decapsulation timing can thus recover information about the HQC private key. The fix replaces table-based arithmetic with table-free methods and makes the sampler branch-free within candidate batches, eliminating these side channels without changing output or randomness consumption.
Potential Impact
The vulnerability allows attackers who can observe cache behavior or timing during cryptographic operations to recover partial information about the HQC private key. This leakage compromises the confidentiality of the private key, potentially weakening the security guarantees of the cryptographic scheme. However, exploitation requires local observation capabilities (local vector attack) and high attack complexity, reflected in the medium CVSS score of 5.9.
Mitigation Recommendations
A fixed version of Bouncy Castle for Java is available starting from version 1.86, which removes the vulnerable table lookups and timing branches. Users should upgrade to version 1.86 or later to mitigate this vulnerability. No additional mitigation is required once upgraded. Since this is not a cloud service, remediation depends on user upgrade.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- bcorg
- Date Reserved
- 2026-07-28T08:50:28.760Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ac11721a43b0b3b89cacf54
Added to database: 10/03/2026, 14:54:25 UTC
Last enriched: 10/03/2026, 14:55:13 UTC
Last updated: 10/04/2026, 05:45:56 UTC
Views: 12
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.