CVE-2023-6237
Medium · 5.9CVSS
5.9
EPSS
2.3%
Published
Apr 25, 2024
CISA due date
—
Cloudanix analysis
A flaw in OpenSSL can let specially crafted encryption keys from outside sources slow down or stall programs that check them, temporarily disrupting services until the check finishes.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- Library
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
EVP_PKEY_public_check() on an overly large prime RSA modulus performs a slow primality test that can consume excessive CPU time, enabling denial of service when the key originates from an untrusted source. The OpenSSL SSL/TLS stack itself is unaffected; only direct callers of the function and the openssl pkey -pubin -check command are exposed.
Why it matters to the business
Services that validate RSA public keys supplied by external users may experience prolonged unresponsiveness or resource exhaustion, degrading availability until the process completes or is terminated. The issue has been public for over two years with stable low exploitation probability and no known ransomware or threat-actor campaigns.
How an attack unfolds
An attacker generates an RSA public key whose modulus is a single very large prime instead of a product of two primes, then supplies this key to any application that calls EVP_PKEY_public_check() on untrusted input. The function begins the expensive composite-number test and blocks for an extended period, starving worker threads or triggering watchdog timeouts.
How to fix it
Upgrade OpenSSL to the commit 0b0f7abfb37350794a4b8960fafc292cd5d1b84d or later; rebuild and redeploy all dependent applications and containers. Disable or restrict use of the openssl pkey -pubin -check command on untrusted files until patched. No configuration workaround exists.
How to confirm the fix worked
Confirm the installed OpenSSL library reports a build containing commit 0b0f7abfb37350794a4b8960fafc292cd5d1b84d, or run a timing test that submits a known large-prime RSA key and verifies the check completes within expected bounds. Monitor build pipelines for the updated source.
Typical attack path
- Craft an RSA public key containing an excessively large prime modulus
- Deliver the key to an application that invokes EVP_PKEY_public_check() on untrusted data
- Trigger the primality test inside the function
- Sustain high CPU usage until the test finishes or the process is killed
How to detect it
Review application and system logs for unusually long execution times or high CPU attributed to RSA key validation routines; correlate with inbound untrusted public-key material. No specific post-exploitation artifacts are produced.
What your security team should do
- Apply the fixed commit to all OpenSSL instances within standard change windows
- Inventory internal code and third-party libraries that directly call EVP_PKEY_public_check() on external keys
- Add timeouts or resource limits around any remaining unpatched key-validation paths
- Update dependency scanners to flag versions prior to the referenced commit
The record
Issue summary: Checking excessively long invalid RSA public keys may take a long time. Impact summary: Applications that use the function EVP_PKEY_public_check() to check RSA public keys may experience long delays. Where the key that is being checked has been obtained from an untrusted source this may lead to a Denial of Service. When function EVP_PKEY_public_check() is called on RSA public keys, a computation is done to confirm that the RSA modulus, n, is composite. For valid RSA keys, n is a product of two or more large primes and this computation completes quickly. However, if n is an overly large prime, then this computation would take a long time. An application that calls EVP_PKEY_public_check() and supplies an RSA key obtained from an untrusted source could be vulnerable to a Denial of Service attack. The function EVP_PKEY_public_check() is not called from other OpenSSL functions however it is called from the OpenSSL pkey command line application. For that reason that application is also vulnerable if used with the '-pubin' and '-check' options on untrusted data. The OpenSSL SSL/TLS implementation is not affected by this issue. The OpenSSL 3.0 and 3.1 FIPS providers are affected by this issue.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:9 | edk2-aarch64 | 0 | 20240524-6.el9_5 |
| AlmaLinux:9 | edk2-ovmf | 0 | 20240524-6.el9_5 |
| AlmaLinux:9 | edk2-tools | 0 | 20240524-6.el9_5 |
| AlmaLinux:9 | edk2-tools-doc | 0 | 20240524-6.el9_5 |
| AlmaLinux:9 | openssl | 0 | 1:3.0.7-27.el9 |
| AlmaLinux:9 | openssl-devel | 0 | 1:3.0.7-27.el9 |
| AlmaLinux:9 | openssl-libs | 0 | 1:3.0.7-27.el9 |
| AlmaLinux:9 | openssl-perl | 0 | 1:3.0.7-27.el9 |
| Alpine:v3.17 | openssl | 0 | 3.0.12-r3 |
| Alpine:v3.18 | openssl | 0 | 3.1.4-r4 |
| Alpine:v3.19 | openssl | 0 | 3.1.4-r4 |
| Alpine:v3.20 | openssl | 0 | 3.1.4-r4 |
| Alpine:v3.21 | openssl | 0 | 3.1.4-r4 |
| Alpine:v3.22 | openssl | 0 | 3.1.4-r4 |
| Chainguard | libcrypto3 | 0 | 3.3.0-r5 |
| Chainguard | libssl3 | 0 | 3.3.0-r5 |
| Chainguard | openssl | 0 | 3.3.0-r5 |
| Chainguard | openssl-config | 0 | 3.3.0-r5 |
| Chainguard | openssl-dbg | 0 | 3.3.0-r5 |
| Chainguard | openssl-dev | 0 | 3.3.0-r5 |
| Chainguard | openssl-doc | 0 | 3.3.0-r5 |
| Chainguard | openssl-engine-afalg | 0 | 3.3.0-r5 |
| Chainguard | openssl-engine-capi | 0 | 3.3.0-r5 |
| Chainguard | openssl-engine-loader-attic | 0 | 3.3.0-r5 |
| Chainguard | openssl-engine-padlock | 0 | 3.3.0-r5 |
| Chainguard | openssl-provider-fips | 0 | 3.4.0-r4 |
| Chainguard | openssl-provider-fips-3.1.2 | 0 | 3.1.2-r3 |
| Chainguard | openssl-provider-fips-3.1.2-dbg | 0 | 3.1.2-r3 |
| Chainguard | openssl-provider-legacy | 0 | 3.3.0-r5 |
| Debian:12 | openssl | 0 | 3.0.13-1~deb12u1 |
| Debian:13 | openssl | 0 | 3.1.5-1 |
| Mageia:9 | openssl | 0 | 3.0.12-1.1.mga9 |
| Mageia:9 | quictls | 0 | 3.0.12-1.1.mga9 |
| Mageia:9 | quictls | 0 | 3.0.14-1.1.mga9 |
| Red Hat:enterprise_linux:9::appstream | edk2 | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::appstream | edk2-aarch64 | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::appstream | edk2-debugsource | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::appstream | edk2-ovmf | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::appstream | edk2-tools | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::appstream | edk2-tools-debuginfo | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::appstream | edk2-tools-doc | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::appstream | openssl | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::appstream | openssl-debuginfo | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::appstream | openssl-debugsource | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::appstream | openssl-devel | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::appstream | openssl-libs | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::appstream | openssl-libs-debuginfo | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::appstream | openssl-perl | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::baseos | openssl | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::baseos | openssl-debuginfo | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::baseos | openssl-debugsource | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::baseos | openssl-devel | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::baseos | openssl-libs | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::baseos | openssl-libs-debuginfo | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::baseos | openssl-perl | 0 | 1:3.0.7-27.el9 |
| Red Hat:enterprise_linux:9::crb | edk2 | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::crb | edk2-aarch64 | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::crb | edk2-debugsource | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::crb | edk2-ovmf | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::crb | edk2-tools | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::crb | edk2-tools-debuginfo | 0 | 0:20240524-6.el9_5 |
| Red Hat:enterprise_linux:9::crb | edk2-tools-doc | 0 | 0:20240524-6.el9_5 |
| Rocky Linux:9 | edk2 | 0 | 0:20240524-6.el9_5.3 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| SUSE:Linux Enterprise Micro 5.3 | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| SUSE:Linux Enterprise Micro 5.4 | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP5 | openssl-3 | 0 | 3.0.8-150500.5.24.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| SUSE:Manager Proxy 4.3 | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| SUSE:Manager Server 4.3 | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| Ubuntu:20.04:LTS | openssl | 0 | 1.1.1f-1ubuntu2.21 |
| Ubuntu:22.04:LTS | nodejs | 0 | No fix |
| Ubuntu:22.04:LTS | openssl | 0 | 3.0.2-0ubuntu1.14 |
| Ubuntu:23.10 | openssl | 0 | 3.0.10-1ubuntu2.2 |
| Ubuntu:24.04:LTS | edk2 | 0 | No fix |
| Ubuntu:24.04:LTS | edk2 | 0 | 2024.02-2ubuntu0.6 |
| Ubuntu:24.04:LTS | openssl | 0 | 3.0.10-1ubuntu4 |
| Ubuntu:24.10 | edk2 | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | nodejs | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | nodejs | 0 | No fix |
| Ubuntu:Pro:22.04:LTS | nodejs | 0 | No fix |
| Ubuntu:Pro:FIPS-preview:22.04:LTS | openssl | 0 | No fix |
| Ubuntu:Pro:FIPS-updates:22.04:LTS | openssl | 0 | 3.0.2-0ubuntu1.14+Fips1 |
| Wolfi | libcrypto3 | 0 | 3.3.0-r5 |
| Wolfi | libssl3 | 0 | 3.3.0-r5 |
| Wolfi | openssl | 0 | 3.3.0-r5 |
| Wolfi | openssl-config | 0 | 3.3.0-r5 |
| Wolfi | openssl-dbg | 0 | 3.3.0-r5 |
| Wolfi | openssl-dev | 0 | 3.3.0-r5 |
| Wolfi | openssl-doc | 0 | 3.3.0-r5 |
| Wolfi | openssl-engine-afalg | 0 | 3.3.0-r5 |
| Wolfi | openssl-engine-capi | 0 | 3.3.0-r5 |
| Wolfi | openssl-engine-loader-attic | 0 | 3.3.0-r5 |
| Wolfi | openssl-engine-padlock | 0 | 3.3.0-r5 |
| Wolfi | openssl-provider-legacy | 0 | 3.3.0-r5 |
| openSUSE:Leap 15.5 | openssl-3 | 0 | 3.0.8-150500.5.24.1 |
| openSUSE:Leap Micro 5.3 | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| openSUSE:Leap Micro 5.4 | openssl-3 | 0 | 3.0.8-150400.4.49.1 |
| openSUSE:Tumbleweed | openssl-3 | 0 | 3.1.4-3.1 |
Related vulnerabilities
- CVE-2024-38796 EDK2 contains a vulnerability in the PeCoffLoaderRelocateImage(). Also affects edk2-aarch64
- CVE-2024-6119 Issue summary: Applications performing certificate name checks (e.g., TLS clients… Also affects edk2-aarch64
- CVE-2024-1298 EDK2 contains a vulnerability when S3 sleep is activated where an Attacker may cause a… Also affects edk2-aarch64
- CVE-2024-0727 Issue summary: Processing a maliciously formatted PKCS12 file may lead OpenSSL to crash… Also affects edk2-aarch64
- CVE-2023-6129 Issue summary: The POLY1305 MAC (message authentication code) implementation contains a… Also affects edk2-aarch64
- CVE-2024-12797 Issue summary: Clients using RFC7250 Raw Public Keys (RPKs) to authenticate a server may… Also affects openssl
- CVE-2024-4741 Issue summary: Calling the OpenSSL API function SSL_free_buffers may cause memory to be… Also affects openssl
- CVE-2024-5535 Issue summary: Calling the OpenSSL API function SSL_select_next_proto with an empty… Also affects openssl