# CVE-2024-54137: liboqs has a correctness error in HQC decapsulation

> An indexing error in liboqs HQC decapsulation incorrectly treats secret key data as public, potentially leaking secret information during malformed ciphertext processing.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Dec 2024
- **Updated:** 10 Dec 2024
- **Also known as:** GHSA-gpf4-vrrw-r8v7, openSUSE-SU-2024:14580-1

## What is CVE-2024-54137?

CVE-2024-54137 is a high-severity vulnerability in open-quantum-safe liboqs, published on 6 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

liboqs is a C-language cryptographic library that provides implementations of post-quantum cryptography algorithms. A correctness error has been identified in the reference implementation of the HQC key encapsulation mechanism. Due to an indexing error, part of the secret key is incorrectly treated as non-secret data. This results in an incorrect shared secret value being returned when the decapsulation function is called with a malformed ciphertext. This vulnerability is fixed in 0.12.0.

Weakness: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2024-54137?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `liboqs` | openSUSE:Tumbleweed | All versions | 0.12.0-1.1 |

Products: Openquantumsafe Liboqs.

## How do I fix CVE-2024-54137?

Upgrade to a fixed version.

## Is CVE-2024-54137 being exploited?

There is no known exploitation of CVE-2024-54137 in the wild and no public exploit code.

## Other vulnerabilities in open-quantum-safe liboqs

- [CVE-2024-31510](https://insights.sbomify.com/CVE-2024-31510/): Other in n/a (critical 9.8)
- [CVE-2025-52473](https://insights.sbomify.com/CVE-2025-52473/): liboqs secret-dependent branching in HQC reference implementation when compiled with Clang 17-20 (medium 5.9)
- [CVE-2024-36405](https://insights.sbomify.com/CVE-2024-36405/): Information disclosure in liboqs (medium 5.9)
- [CVE-2026-44518](https://insights.sbomify.com/CVE-2026-44518/): liboqs: XMSS Buffer Overread Bug (medium 5.3)
- [CVE-2026-46344](https://insights.sbomify.com/CVE-2026-46344/): liboqs: Heap-buffer-overflow in XMSS verification path via OID-controlled parameter mismatch (xmss_commons.c:194) (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-54137 and fix it if it is affected.

What it is: CVE-2024-54137 is a high-severity vulnerability in open-quantum-safe liboqs, published on 6 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-54137 in the wild and no public exploit code.

Affected product: open-quantum-safe liboqs. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-54137/ (Markdown: https://insights.sbomify.com/CVE-2024-54137/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-54137
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-54137
- OSV: https://osv.dev/vulnerability/CVE-2024-54137

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-54137/
Summaries are generated and may contain mistakes; the official description above is the record.
