---
title: "liboqs HQC decapsulation returned wrong secret for malformed ciphertexts (CVE-2024-54137)"
url: "https://pqt-19a6ffd695e12a.pages.dev/feed/2024-12-06-liboqs-hqc-decapsulation-returned-wrong-secret-f/"
date: "2024-12-06"
classification: "Implementation vulnerability"
action: "Patch"
affects: ["HQC"]
site: "PQ Tracker, maintained by zkSecurity"
reviewed: "2026-11-25"
license: "https://creativecommons.org/licenses/by/4.0/"
---

# liboqs HQC decapsulation returned wrong secret for malformed ciphertexts (CVE-2024-54137)

2024-12-06 · Implementation vulnerability · Action: patch

An indexing error in the HQC reference implementation shipped in liboqs (and PQClean) treated part of the secret key as non-secret data, so decapsulating a malformed ciphertext returned an incorrect shared secret. It was fixed in liboqs 0.12.0. This is a correctness bug in one code base; the advisory does not describe an exploit.

- Affects: [HQC](https://pqt-19a6ffd695e12a.pages.dev/algorithms/hqc/)

## Sources

- [CVE-2024-54137 record](https://www.cve.org/CVERecord?id=CVE-2024-54137)
- [liboqs advisory GHSA-gpf4-vrrw-r8v7](https://github.com/open-quantum-safe/liboqs/security/advisories/GHSA-gpf4-vrrw-r8v7)

## Related entries

- 2025-07-10 · Implementation vulnerability · Demonstrated · Action: patch · [Clang-introduced secret-dependent branches in liboqs HQC leak the key (CVE-2025-52473)](https://pqt-19a6ffd695e12a.pages.dev/feed/2025-07-10-clang-introduced-secret-dependent-branches-in-li/)
- 2025-04-02 · Reduced security margin · Action: patch · [IND-CCA2 flaw in HQC's February 2025 specification: salt not covered by the FO check](https://pqt-19a6ffd695e12a.pages.dev/feed/2025-04-02-ind-cca2-flaw-in-hqc-s-february-2025-specificati/)
- 2025-03-11 · Selection · [NIST selects HQC as a second KEM; fourth round ends (NIST IR 8545)](https://pqt-19a6ffd695e12a.pages.dev/feed/2025-03-11-nist-selects-hqc-as-a-second-kem-fourth-round-en/)
- 2022-06-08 · Implementation vulnerability · Demonstrated · Action: patch · [Timing key-recovery attack on HQC (and BIKE) via rejection sampling in decapsulation](https://pqt-19a6ffd695e12a.pages.dev/feed/2022-06-08-timing-key-recovery-attack-on-hqc-and-bike-via-r/)
