Skip to content
OpenAdvisories
High · 7.5 Public exploit CVE-2021-4044 BIT-node-2021-4044BIT-node-min-2021-4044EUVD-2021-2556GHSA-mmjf-f5jw-w72qRUSTSEC-2021-0129

Invalid handling of X509_verify_cert() internal errors in libssl

Published Dec 14, 2021 · Updated Sep 17, 2024 · Assigned by openssl

Description

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

Affected products

VendorProductAffectedFixed
OpenSSL OpenSSL Fixed in OpenSSL 3.0.1 (Affected 3.0.0) —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS openssl 3.0.1-0ubuntu1 —
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed openssl-3 3.0.1-1.1 openSUSE-SU-2024:11797-1
ReleasePackageFixed inAdvisory
Alpine v3.24 openssl 3.0.1-r0 —
Alpine v3.23 openssl 3.0.1-r0 —
Alpine v3.22 openssl 3.0.1-r0 —
Alpine v3.21 openssl 3.0.1-r0 —
Alpine v3.20 openssl 3.0.1-r0 —
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 openssl 3.0.1-r0 —
Alpine v3.18 openssl 3.0.1-r0 —
Alpine v3.17 openssl 3.0.1-r0 —
Alpine v3.16 openssl3 3.0.1-r0 —
Alpine v3.15 openssl3 3.0.2-r0 —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
crates.io openssl-src >= 300.0.0, < 300.0.4 300.0.4 GHSA-mmjf-f5jw-w72q

Advisories 3

References