CVE-2023-5363
High · 7.5CVSS
7.5
EPSS
3.3%
Published
Oct 25, 2023
CISA due date
—
Cloudanix analysis
A problem in the OpenSSL encryption library can weaken certain types of data protection in rare situations, potentially letting attackers read information that should stay private.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Library
- Class
- Cryptographic Weakness
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Bug in EVP_EncryptInit_ex2, EVP_DecryptInit_ex2 and EVP_CipherInit_ex2 causes OSSL_PARAM keylen/ivlen changes to be ignored after key/IV setup, resulting in IV truncation or key/IV overruns for RC2/RC4/RC5/CCM/GCM/OCB, producing non-unique IVs or incorrect cipher output that can leak confidentiality in GCM/CCM/OCB modes.
Why it matters to the business
Rare but serious risk of confidentiality loss in applications performing dynamic key or IV length changes with affected symmetric ciphers; low likelihood due to uncommon usage pattern and recent API introduction reduces operational urgency despite 1086 days of exposure.
How an attack unfolds
An attacker identifies an application that calls the vulnerable EVP_*Init_ex2 functions with OSSL_PARAM arrays altering keylen or ivlen after initial setup, supplies crafted parameters that cause IV truncation (especially in deterministic GCM constructions), and observes resulting IV reuse or decryption failures to recover plaintext.
How to fix it
Upgrade OpenSSL to the fixed commit c3cc0f1386b0544383a61244a4beeb762b67498f or later; rebuild and redeploy all dependent applications and libraries; avoid dynamic key/IV length changes via OSSL_PARAM until patched.
How to confirm the fix worked
Confirm OpenSSL library version or commit contains c3cc0f1386b0544383a61244a4beeb762b67498f; run regression tests exercising EVP_*Init_ex2 with keylen/ivlen OSSL_PARAM on affected ciphers and verify correct IV/key lengths are applied.
Typical attack path
- Locate application using OpenSSL 3.0/3.1 with CCM/GCM/OCB or legacy RC ciphers that dynamically sets key/IV lengths via OSSL_PARAM
- Trigger calls to EVP_EncryptInit_ex2 or equivalent with malicious keylen/ivlen parameters
- Induce IV truncation leading to reuse or overread conditions
- Decrypt or observe ciphertext to compromise confidentiality
How to detect it
Review application logs for cipher initialization errors, decryption failures, or unexpected IV reuse warnings when using affected modes; inspect source for calls to EVP_*Init_ex2 followed by keylen or ivlen OSSL_PARAM; no public exploitation artifacts reported.
What your security team should do
- Inventory all OpenSSL 3.0 and 3.1 deployments and flag any use of CCM/GCM/OCB or RC ciphers with dynamic length parameters
- Apply the fix commit c3cc0f1386b0544383a61244a4beeb762b67498f or newer releases immediately on internet-facing or high-value systems
- Update build pipelines and dependency manifests to enforce the patched version
- Monitor EPSS and KEV status for any future increase in exploitation likelihood
The record
Issue summary: A bug has been identified in the processing of key and initialisation vector (IV) lengths. This can lead to potential truncation or overruns during the initialisation of some symmetric ciphers. Impact summary: A truncation in the IV can result in non-uniqueness, which could result in loss of confidentiality for some cipher modes. When calling EVP_EncryptInit_ex2(), EVP_DecryptInit_ex2() or EVP_CipherInit_ex2() the provided OSSL_PARAM array is processed after the key and IV have been established. Any alterations to the key length, via the "keylen" parameter or the IV length, via the "ivlen" parameter, within the OSSL_PARAM array will not take effect as intended, potentially causing truncation or overreading of these values. The following ciphers and cipher modes are impacted: RC2, RC4, RC5, CCM, GCM and OCB. For the CCM, GCM and OCB cipher modes, truncation of the IV can result in loss of confidentiality. For example, when following NIST's SP 800-38D section 8.2.1 guidance for constructing a deterministic IV for AES in GCM mode, truncation of the counter portion could lead to IV reuse. Both truncations and overruns of the key and overruns of the IV will produce incorrect results and could, in some cases, trigger a memory exception. However, these issues are not currently assessed as security critical. Changing the key and/or IV lengths is not considered to be a common operation and the vulnerable API was recently introduced. Furthermore it is likely that application developers will have spotted this problem during testing since decryption would fail unless both peers in the communication were similarly vulnerable. For these reasons we expect the probability of an application being vulnerable to this to be quite low. However if an application is vulnerable then this issue is considered very serious. For these reasons we have assessed this issue as Moderate severity overall. 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 because the issue lies outside of the FIPS provider boundary. OpenSSL 3.1 and 3.0 are vulnerable to this issue.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:9 | openssl | 0 | 1:3.0.7-25.el9_3 |
| AlmaLinux:9 | openssl-devel | 0 | 1:3.0.7-25.el9_3 |
| AlmaLinux:9 | openssl-libs | 0 | 1:3.0.7-25.el9_3 |
| AlmaLinux:9 | openssl-perl | 0 | 1:3.0.7-25.el9_3 |
| Alpine:v3.17 | openssl | 0 | 3.0.12-r0 |
| Alpine:v3.18 | openssl | 0 | 3.1.4-r0 |
| Alpine:v3.19 | openssl | 0 | 3.1.4-r0 |
| Alpine:v3.20 | openssl | 0 | 3.1.4-r0 |
| Alpine:v3.21 | openssl | 0 | 3.1.4-r0 |
| Alpine:v3.22 | openssl | 0 | 3.1.4-r0 |
| Chainguard | libcrypto3 | 0 | 3.1.4-r0 |
| Chainguard | libssl3 | 0 | 3.1.4-r0 |
| Chainguard | openssl | 0 | 3.1.4-r0 |
| Chainguard | openssl-config | 0 | 3.1.4-r0 |
| Chainguard | openssl-dbg | 0 | 3.1.4-r0 |
| Chainguard | openssl-dev | 0 | 3.1.4-r0 |
| Chainguard | openssl-doc | 0 | 3.1.4-r0 |
| Chainguard | openssl-engine-afalg | 0 | 3.1.4-r0 |
| Chainguard | openssl-engine-capi | 0 | 3.1.4-r0 |
| Chainguard | openssl-engine-loader-attic | 0 | 3.1.4-r0 |
| Chainguard | openssl-engine-padlock | 0 | 3.1.4-r0 |
| Chainguard | openssl-provider-fips | 0 | 0 |
| Chainguard | openssl-provider-fips-3.1.2 | 0 | 0 |
| Chainguard | openssl-provider-fips-3.1.2-dbg | 0 | 0 |
| Chainguard | openssl-provider-legacy | 0 | 3.1.4-r0 |
| Chainguard | ruby-3.2 | 0 | 0 |
| Chainguard | ruby-3.2-base | 0 | 0 |
| Chainguard | ruby-3.2-base-dev | 0 | 0 |
| Chainguard | ruby-3.2-dev | 0 | 0 |
| Chainguard | ruby-3.2-doc | 0 | 0 |
| Debian:12 | openssl | 0 | 3.0.11-1~deb12u2 |
| Debian:13 | openssl | 0 | 3.0.12-1 |
| Mageia:9 | openssl | 0 | 3.0.12-1.mga9 |
| Mageia:9 | quictls | 0 | 3.0.12-1.mga9 |
| Red Hat:enterprise_linux:9::appstream | openssl | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::appstream | openssl-debuginfo | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::appstream | openssl-debugsource | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::appstream | openssl-devel | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::appstream | openssl-libs | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::appstream | openssl-libs-debuginfo | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::appstream | openssl-perl | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::baseos | openssl | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::baseos | openssl-debuginfo | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::baseos | openssl-debugsource | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::baseos | openssl-devel | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::baseos | openssl-libs | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::baseos | openssl-libs-debuginfo | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:enterprise_linux:9::baseos | openssl-perl | 0 | 1:3.0.7-25.el9_3 |
| Red Hat:rhel_eus:9.2::appstream | openssl | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | openssl-debuginfo | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | openssl-debugsource | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | openssl-devel | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | openssl-libs | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | openssl-libs-debuginfo | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::appstream | openssl-perl | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::baseos | openssl | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::baseos | openssl-debuginfo | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::baseos | openssl-debugsource | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::baseos | openssl-devel | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::baseos | openssl-libs | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::baseos | openssl-libs-debuginfo | 0 | 1:3.0.7-18.el9_2 |
| Red Hat:rhel_eus:9.2::baseos | openssl-perl | 0 | 1:3.0.7-18.el9_2 |
| SUSE:Linux Enterprise Micro 5.3 | openssl-3 | 0 | 3.0.8-150400.4.37.1 |
| SUSE:Linux Enterprise Micro 5.4 | openssl-3 | 0 | 3.0.8-150400.4.37.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP4 | openssl-3 | 0 | 3.0.8-150400.4.37.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP5 | openssl-3 | 0 | 3.0.8-150500.5.14.1 |
| Ubuntu:22.04:LTS | nodejs | 0 | No fix |
| Ubuntu:22.04:LTS | openssl | 0 | 3.0.2-0ubuntu1.12 |
| Ubuntu:23.10 | openssl | 0 | 3.0.10-1ubuntu2.1 |
| Ubuntu:24.04:LTS | openssl | 0 | 3.0.10-1ubuntu2.1 |
| 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 | 3.0.2-0ubuntu1.12+Fips1 |
| Ubuntu:Pro:FIPS-updates:22.04:LTS | openssl | 0 | 3.0.2-0ubuntu1.12+Fips1 |
| Wolfi | libcrypto3 | 0 | 3.1.4-r0 |
| Wolfi | libssl3 | 0 | 3.1.4-r0 |
| Wolfi | openssl | 0 | 3.1.4-r0 |
| Wolfi | openssl-config | 0 | 3.1.4-r0 |
| Wolfi | openssl-dbg | 0 | 3.1.4-r0 |
| Wolfi | openssl-dev | 0 | 3.1.4-r0 |
| Wolfi | openssl-doc | 0 | 3.1.4-r0 |
| Wolfi | openssl-engine-afalg | 0 | 3.1.4-r0 |
| Wolfi | openssl-engine-capi | 0 | 3.1.4-r0 |
| Wolfi | openssl-engine-loader-attic | 0 | 3.1.4-r0 |
| Wolfi | openssl-engine-padlock | 0 | 3.1.4-r0 |
| Wolfi | openssl-provider-legacy | 0 | 3.1.4-r0 |
| Wolfi | ruby-3.2 | 0 | 0 |
| Wolfi | ruby-3.2-base | 0 | 0 |
| Wolfi | ruby-3.2-base-dev | 0 | 0 |
| Wolfi | ruby-3.2-dev | 0 | 0 |
| Wolfi | ruby-3.2-doc | 0 | 0 |
| conan | openssl | 3.0.0 | 3.0.12 |
| conan | openssl | 3.1.0 | 3.1.4 |
| openSUSE:Leap 15.4 | openssl-3 | 0 | 3.0.8-150400.4.37.1 |
| openSUSE:Leap 15.5 | openssl-3 | 0 | 3.0.8-150500.5.14.1 |
| openSUSE:Leap Micro 5.3 | openssl-3 | 0 | 3.0.8-150400.4.37.1 |
| openSUSE:Leap Micro 5.4 | openssl-3 | 0 | 3.0.8-150400.4.37.1 |
| openSUSE:Tumbleweed | openssl-3 | 0 | 3.1.4-1.1 |
Related vulnerabilities
- 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-6119 Issue summary: Applications performing certificate name checks (e.g., TLS clients… Also affects openssl
- CVE-2024-5535 Issue summary: Calling the OpenSSL API function SSL_select_next_proto with an empty… Also affects openssl
- CVE-2024-4603 Issue summary: Checking excessively long DSA keys or parameters may be very slow. Also affects openssl
- CVE-2023-6237 Issue summary: Checking excessively long invalid RSA public keys may take a long time. Also affects openssl
- CVE-2024-2511 Issue summary: Some non-default TLS server configurations can cause unbounded memory… Also affects openssl
- CVE-2024-0727 Issue summary: Processing a maliciously formatted PKCS12 file may lead OpenSSL to crash… Also affects openssl