CVEfocus › CVE database › CVE-2021-4044

CVE-2021-4044Invalid handling of X509_verify_cert() internal errors in libssl

CVSS 7.5 HighEPSS 50.1% (in the top 1% of all CVEs)Published 2021-12-14Updated 2024-09-17Assigner: openssl

Internally libssl in OpenSSL calls X509_verify_cert() on the client side to verify a certificate supplied by a server. That function may return a negative return value to indicate an internal error (for example out of memory). Such a negative return value is mishandled by OpenSSL and will cause an IO function (such as SSL_connect() or SSL_do_handshake()) to not indicate success and a subsequent call to SSL_get_error() to return the value SSL_ERROR_WANT_RETRY_VERIFY. This return value is only supposed to be returned by OpenSSL if the application has previously called SSL_CTX_set_cert_verify_callback(). Since most applications do not do this the SSL_ERROR_WANT_RETRY_VERIFY return value from SSL_get_error() will be totally unexpected and applications may not behave correctly as a result. The exact behaviour will depend on the application but it could result in crashes, infinite loops or other similar incorrect responses. This issue is made more serious in combination with a separate bug in OpenSSL 3.0 that will cause X509_verify_cert() to indicate an internal error when processing a certificate chain. This will occur where a certificate does not include the Subject Alternative Name extension but where a Certificate Authority has enforced name constraints. This issue can occur even with valid chains. By combining the two issues an attacker could induce incorrect, application dependent behaviour. Fixed in OpenSSL 3.0.1 (Affected 3.0.0).

What to do

Likely to be exploited: EPSS gives a 50% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.

Fixed builds are available from Alpine, Ubuntu, crates.io: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

12Fixed
1Fix pending
25Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04edk2Not affected
vulnerable_code_not_present
Ubuntu 22.04opensslFixed3.0.1-0ubuntu1UBUNTU-CVE-2021-4044
Ubuntu 16.04edk2Not affected
vulnerable_code_not_present
Ubuntu 16.04nodejsNot affected
vulnerable_code_not_present
Ubuntu 16.04opensslNot affected
vulnerable_code_not_present
Ubuntu 14.04edk2Fix pending
Red Hat Enterprise Linux 9opensslNot affected
Red Hat Enterprise Linux 9openssl-develNot affected
Red Hat Enterprise Linux 9openssl-libsNot affected
Red Hat Enterprise Linux 9openssl-perlNot affected
Red Hat Enterprise Linux 8compat-openssl10Not affected
Red Hat Enterprise Linux 8opensslNot affected
Red Hat Enterprise Linux 8openssl-develNot affected
Red Hat Enterprise Linux 8openssl-libsNot affected
Red Hat Enterprise Linux 8openssl-perlNot affected
Red Hat Enterprise Linux 8openssl-staticNot affected
Red Hat Enterprise Linux 7opensslNot affected
Red Hat Enterprise Linux 7openssl-develNot affected
Red Hat Enterprise Linux 7openssl-libsNot affected
Red Hat Enterprise Linux 7openssl-perlNot affected
Red Hat Enterprise Linux 7openssl-staticNot affected
Red Hat Enterprise Linux 7openssl098eNot affected
Red Hat Enterprise Linux 6opensslNot affected
Red Hat Enterprise Linux 6openssl-develNot affected
Red Hat Enterprise Linux 6openssl-perlNot affected
Red Hat Enterprise Linux 6openssl-staticNot affected
Red Hat Enterprise Linux 6openssl098eNot affected
Alpine Linux 3.24opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.23opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.22opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.21opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.20opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.19opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.18opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.17opensslFixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.16openssl3Fixed3.0.1-r0ALPINE-CVE-2021-4044
Alpine Linux 3.15openssl3Fixed3.0.2-r0ALPINE-CVE-2021-4044
crates.io libraryopenssl-srcFixed300.0.4RUSTSEC-2021-0129

What the vendor says

As published in the CVE record by openssl, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.