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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: Low
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 4.35% (percentile 92, 2026-11-26)
- **CWE:** CWE-606
- **Published:** 2023-11-06T15:47:30.795Z
- **Modified:** 2026-10-14T22:17:19.870Z

## Who should check

- Anyone running OpenSSL \>= 1.0.2, \< 1.0.2zj; \>= 1.1.1, \< 1.1.1x; \>= 3.0.0, \< 3.0.13; \>= 3.1.0, \< 3.1.5

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

## Affected and fixed versions

- OpenSSL: \>= 1.0.2, \< 1.0.2zj; \>= 1.1.1, \< 1.1.1x; \>= 3.0.0, \< 3.0.13; \>= 3.1.0, \< 3.1.5 (cvelist)

## Mitigation

- Upgrade OpenSSL to 3.1.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-5678. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-5678.md
Affected: OpenSSL >= 1.0.2, < 1.0.2zj; >= 1.1.1, < 1.1.1x; >= 3.0.0, < 3.0.13; >= 3.1.0, < 3.1.5
Fixed in: OpenSSL 1.0.2zj, OpenSSL 1.1.1x, OpenSSL 3.0.13, OpenSSL 3.1.5

Steps:
1. Search this machine and project for OpenSSL: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-5678 being exploited?

There is no confirmed exploitation: CVE-2023-5678 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 4.35% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-5678?

Medium: CVSS 5.3 (v3.1, scored by CNA). Remote, no login needed.

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

OpenSSL \>= 1.0.2, \< 1.0.2zj; \>= 1.1.1, \< 1.1.1x; \>= 3.0.0, \< 3.0.13; \>= 3.1.0, \< 3.1.5.

### Is there a fix for CVE-2023-5678?

Yes. Fixed in OpenSSL 1.0.2zj, OpenSSL 1.1.1x, OpenSSL 3.0.13, OpenSSL 3.1.5. Upgrade OpenSSL to 3.1.5 or later.

### How do I check if I'm affected by CVE-2023-5678?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://www.openssl.org/news/secadv/20231106.txt>
- patch: <https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=34efaef6c103d636ab507a0cc34dca4d3aecc055>
- patch: <https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=710fee740904b6290fef0dd5536fbcedbc38ff0c>
- patch: <https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=db925ae2e65d0d925adef429afc37f75bd1c2017>
- patch: <https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=ddeb4b6c6d527e54ce9a99cba785c0f7776e54b6>
- other: <https://security.netapp.com/advisory/ntap-20231130-0010/>
- other: <http://www.openwall.com/lists/oss-security/2024/03/11/1>
- other: <https://lists.debian.org/debian-lts-announce/2024/11/msg00000.html>
- other: <https://lists.debian.org/debian-lts-announce/2024/10/msg00033.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-794697.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-128433.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-556635.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-093430.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-341067.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-331112.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-915275.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-769027.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-277137.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-613116.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-5678>

HTML: <https://flawdb.com/CVE-2023-5678> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-5678>
