# CVE-2024-37305: Buffer overflow in deserialization in oqs-provider

> Attackers can cause crashes or leak information via malformed hybrid keys in the oqs-provider library for OpenSSL.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Jun 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-pqvr-5cr8-v6fx, openSUSE-SU-2024:14054-1

## What is CVE-2024-37305?

CVE-2024-37305 is a high-severity memory corruption vulnerability in open-quantum-safe oqs-provider, published on 17 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

oqs-provider is a provider for the OpenSSL 3 cryptography library that adds support for post-quantum cryptography in TLS, X.509, and S/MIME using post-quantum algorithms from liboqs. Flaws have been identified in the way oqs-provider handles lengths decoded with DECODE_UINT32 at the start of serialized hybrid (traditional + post-quantum) keys and signatures. Unchecked length values are later used for memory reads and writes; malformed input can lead to crashes or information leakage. Handling of plain/non-hybrid PQ key operation is not affected. This issue has been patched in in v0.6.1. All users are advised to upgrade. There are no workarounds for this issue.

Weakness: CWE-805 (Buffer Access with Incorrect Length Value), CWE-680 (Integer Overflow to Buffer Overflow), CWE-190 (Integer Overflow or Wraparound), CWE-130 (Improper Handling of Length Parameter Inconsistency), CWE-120 (Buffer Copy without Checking Size of Input)

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `oqs-provider` | openSUSE:Tumbleweed | All versions | 0.6.1-1.1 |

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

Upgrade to a fixed version.

## Is CVE-2024-37305 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-37305 is a high-severity memory corruption vulnerability in open-quantum-safe oqs-provider, published on 17 Jun 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-37305 in the wild and no public exploit code.

Affected product: open-quantum-safe oqs-provider. 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-37305/ (Markdown: https://insights.sbomify.com/CVE-2024-37305/index.md)
```

## Sources

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

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