CVE-2026-18040

HQC leaks private key information through secret-indexed GF(2^8) tables and a secret-dependent fixed-weight sampler

Published Oct 3, 2026 CVSS 4.0 · 5.9 Medium EPSS < 1% KEV · Not listed
Description
In Bouncy Castle for Java before 1.86, HQC leaked secret-derived data through two side channels: its GF(2^8) arithmetic used lookup tables indexed by field elements, making the cache line touched a function of the operand, and its fixed-weight support sampler left its duplicate scan as soon as a collision was found and stored accepted positions at a secret index. Both run on secret inputs during encapsulation and decapsulation, and the sampler re-expands the secret key from its seed on every decapsulation, so an attacker able to observe cache behaviour or decapsulation timing can recover information about the HQC private key. The field arithmetic is now table-free and the sampler branch-free within a batch of candidates, with output and randomness consumption unchanged.

Analysis

AI-generated

Technical impact

Bouncy Castle for Java contains a side‑channel vulnerability that can expose the HQC private key through cache‑based and timing attacks. The flaw consists of two parts: the GF(2^8) arithmetic uses secret‑dependent lookup tables, causing cache line access patterns that reflect the key material; and the fixed‑weight sampler terminates early on a collision and stores positions at secret indices, creating observable timing behavior. An attacker who can measure cache accesses or encapsulation/decapsulation timing can recover portions of the private key, mapping to CWE‑208, Information Exposure.

Affected Systems

Legion of the Bouncy Castle Inc. produces the BC-Java library. Any Java application that loads a version of BC-Java older than 1.86, and performs HQC encapsulation or decapsulation, is vulnerable. The vulnerability affects all deployments that include those operations before the 1.86 release, which removes the table‑based arithmetic and makes the sampler branch‑free.

Risk and Exploitability

The CVSS v3 score of 5.9 indicates moderate severity. EPSS is not available, so current exploit prevalence is unclear; the vulnerability is not yet listed in the CISA KEV catalog. Based on the description, it is inferred that exploitation requires an observer who can monitor cache behavior or measure execution timing, such as a local user or an attacker with shared hyper‑visor resources. Because the side channel depends on secret inputs during encapsulation and decapsulation, repeated operations are needed to accumulate enough data to reconstruct the key. Recovering private key material would represent a serious compromise of confidentiality.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Bouncy Castle to version 1.86 or later, which removes the table‑based arithmetic and makes the sampler branch‑free.
  • If upgrading is not possible, disable or replace any use of HQC key encapsulation in the application with a different algorithm.
  • Apply operating‑system or hardware mitigations against cache‑timing attacks, such as enabling KASLR, page‑granularity cache flushing, or running the application in a dedicated enclave or virtual machine.
  • If the environment supports it, perform key encapsulation on a trusted hardware module or a dedicated secure server to isolate key usage from the main application code.

Generated by OpenCVE AI on October 3, 2026 at 11:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Legion Of The Bouncy Castle Inc.
Legion Of The Bouncy Castle Inc. bc-java
Vendors & Products Legion Of The Bouncy Castle Inc.
Legion Of The Bouncy Castle Inc. bc-java
Type Values Removed Values Added
Description In Bouncy Castle for Java before 1.86, HQC leaked secret-derived data through two side channels: its GF(2^8) arithmetic used lookup tables indexed by field elements, making the cache line touched a function of the operand, and its fixed-weight support sampler left its duplicate scan as soon as a collision was found and stored accepted positions at a secret index. Both run on secret inputs during encapsulation and decapsulation, and the sampler re-expands the secret key from its seed on every decapsulation, so an attacker able to observe cache behaviour or decapsulation timing can recover information about the HQC private key. The field arithmetic is now table-free and the sampler branch-free within a batch of candidates, with output and randomness consumption unchanged.
Title HQC leaks private key information through secret-indexed GF(2^8) tables and a secret-dependent fixed-weight sampler
Weaknesses CWE-208
References
Metrics cvssV4_0

{'score': 5.9, 'vector': 'CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/U:Amber'}

Weaknesses
  • CWE-208

    Observable Timing Discrepancy

Sources

Status
PUBLISHED
Assigner
bcorg
Published
Updated
Oct 5, 2026, 4:00 PM
Reserved
Jul 28, 2026, 8:50 AM
Status
Awaiting Analysis
Published
Oct 3, 2026, 9:17 AM
Modified
Oct 6, 2026, 2:49 PM