# CVE-2023-5678: Excessive time spent in DH check / generation with large Q parameter value

> Attackers can cause denial of service by supplying large Q parameters to vulnerable OpenSSL DH key generation or checking functions.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Nov 2023
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2023-5678, AZL-31872, AZL-31880, AZL-34666, AZL-35084, AZL-37740, AZL-39659, AZL-42685, AZL-42736, AZL-78555, BELL-CVE-2023-5678, CLEANSTART-2026-LZ61437, CLSA-2024-1708638837, CLSA-2024-1709839769, DEBIAN-CVE-2023-5678, GHSA-2cj7-mg3x-9mhq, JLSEC-2026-244, OESA-2023-1821, OESA-2025-1747, OESA-2025-1802, SUSE-SU-2023:4488-1, SUSE-SU-2023:4489-1, SUSE-SU-2023:4518-1, SUSE-SU-2023:4519-1, SUSE-SU-2023:4520-1, SUSE-SU-2023:4521-1, SUSE-SU-2023:4522-1, SUSE-SU-2023:4523-1, SUSE-SU-2023:4524-1, SUSE-SU-2023:4593-1, SUSE-SU-2023:4635-1, SUSE-SU-2023:4649-1, SUSE-SU-2023:4918-1, SUSE-SU-2023:4919-1, UBUNTU-CVE-2023-5678, openSUSE-SU-2024:13428-1, openSUSE-SU-2024:13437-1, openSUSE-SU-2024:13438-1

## What is CVE-2023-5678?

CVE-2023-5678 is a medium-severity denial of service vulnerability in Openssl Openssl, published on 6 Nov 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Issue summary: Generating excessively long X9.42 DH keys or checking
excessively long X9.42 DH keys or parameters may be very slow.

Impact summary: Applications that use the functions DH_generate_key() to
generate an X9.42 DH key may experience long delays.  Likewise, applications
that use DH_check_pub_key(), DH_check_pub_key_ex() or EVP_PKEY_public_check()
to check an X9.42 DH key or X9.42 DH parameters may experience long delays.
Where the key or parameters that are being checked have been obtained from
an untrusted source this may lead to a Denial of Service.

While DH_check() performs all the necessary checks (as of CVE-2023-3817),
DH_check_pub_key() doesn't make any of these checks, and is therefore
vulnerable for excessively large P and Q parameters.

Likewise, while DH_generate_key() performs a check for an excessively large
P, it doesn't check for an excessively large Q.

An application that calls DH_generate_key() or DH_check_pub_key() and
supplies a key or parameters obtained from an untrusted source could be
vulnerable to a Denial of Service attack.

DH_generate_key() and DH_check_pub_key() are also called by a number of
other OpenSSL functions.  An application calling any of those other
functions may similarly be affected.  The other functions affected by this
are DH_check_pub_key_ex(), EVP_PKEY_public_check(), and EVP_PKEY_generate().

Also vulnerable are the OpenSSL pkey command line application when using the
"-pubcheck" option, as well as the OpenSSL genpkey command line application.

The OpenSSL SSL/TLS implementation is not affected by this issue.

The OpenSSL 3.0 and 3.1 FIPS providers are not affected by this issue.

Weakness: CWE-754 (Improper Check for Unusual or Exceptional Conditions), CWE-606 (Unchecked Input for Loop Condition)

## Which versions are affected by CVE-2023-5678?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openssl-1_0_0` | SUSE:Enterprise Storage 7.1 | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_1` | SUSE:Enterprise Storage 7.1 | All versions | 1.1.1d-150200.11.82.1 |
| `openssl-1_1` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.1.0i-150100.14.68.1 |
| `openssl-1_1` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.1.1d-150200.11.82.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_1` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 1.1.1d-150200.11.82.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_1` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.1.1d-150200.11.82.1 |
| `openssl-1_1-livepatches` | SUSE:Linux Enterprise Live Patching 15 SP4 | All versions | 0.2-150400.3.6.1 |
| `openssl-1_1-livepatches` | SUSE:Linux Enterprise Live Patching 15 SP5 | All versions | 0.2-150500.6.3.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Micro 5.1 | All versions | 1.1.1d-150200.11.82.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Micro 5.2 | All versions | 1.1.1d-150200.11.82.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Micro 5.3 | All versions | 1.1.1l-150400.7.60.2 |
| `openssl-3` | SUSE:Linux Enterprise Micro 5.3 | All versions | 3.0.8-150400.4.42.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Micro 5.4 | All versions | 1.1.1l-150400.7.60.2 |
| `openssl-3` | SUSE:Linux Enterprise Micro 5.4 | All versions | 3.0.8-150400.4.42.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Micro 5.5 | All versions | 1.1.1l-150500.17.22.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 1.1.1l-150400.7.60.2 |
| `openssl-3` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 3.0.8-150400.4.42.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 1.1.1l-150500.17.22.1 |
| `openssl-3` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 3.0.8-150500.5.19.1 |
| `compat-openssl098` | SUSE:Linux Enterprise Module for Legacy 12 | All versions | 0.9.8j-106.61.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Module for Legacy 15 SP4 | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Module for Legacy 15 SP5 | All versions | 1.0.2p-150000.3.88.1 |
| `openssl` | SUSE:Linux Enterprise Server 11 SP4 LTSS EXTREME CORE | All versions | 0.9.8j-0.106.80.1 |
| `openssl1` | SUSE:Linux Enterprise Server 11 SP4 LTSS EXTREME CORE | All versions | 1.0.1g-0.58.76.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 1.0.2p-3.87.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 1.1.1d-2.101.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 1.1.0i-150100.14.68.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 1.1.1d-150200.11.82.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.1.1d-150200.11.82.1 |
| `compat-openssl098` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 0.9.8j-106.61.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 1.0.2p-3.87.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 1.1.1d-2.101.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 1.0.2p-150000.3.88.1 |
| `openssl-1_1` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 1.1.0i-150100.14.68.1 |
| `openssl-1_0_0` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 1.0.2p-150000.3.88.1 |

Products: Openssl Openssl.

## How do I fix CVE-2023-5678?

Apply the vendor's patch.

## Is CVE-2023-5678 being exploited?

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

## Other vulnerabilities in Openssl Openssl

- [CVE-2009-3245](https://insights.sbomify.com/CVE-2009-3245/): Null dereference in n/a (critical 10.0)
- [CVE-2006-3738](https://insights.sbomify.com/CVE-2006-3738/): Memory corruption in n/a (critical 10.0)
- [CVE-2026-63073](https://insights.sbomify.com/CVE-2026-63073/): Untrusted Sender DN Used as Format String in CMP Response Validation (critical 9.8)
- [CVE-2016-6309](https://insights.sbomify.com/CVE-2016-6309/): Use after free in n/a (critical 9.8)
- [CVE-2016-0799](https://insights.sbomify.com/CVE-2016-0799/): Integer overflow in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-5678 and fix it if it is affected.

What it is: CVE-2023-5678 is a medium-severity denial of service vulnerability in Openssl Openssl, published on 6 Nov 2023. 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-2023-5678 in the wild and no public exploit code.

Affected product: Openssl Openssl. 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-2023-5678/ (Markdown: https://insights.sbomify.com/CVE-2023-5678/index.md)
```

## Sources

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

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