CVE-2021-3450 - Improper Certificate Validation

Severity

74%

Complexity

22%

Confidentiality

86%

The X509_V_FLAG_X509_STRICT flag enables additional security checks of the certificates present in a certificate chain. It is not set by default. Starting from OpenSSL version 1.1.1h a check to disallow certificates in the chain that have explicitly encoded elliptic curve parameters was added as an additional strict check. An error in the implementation of this check meant that the result of a previous check to confirm that certificates in the chain are valid CA certificates was overwritten. This effectively bypasses the check that non-CA certificates must not be able to issue other certificates. If a "purpose" has been configured then there is a subsequent opportunity for checks that the certificate is a valid CA. All of the named "purpose" values implemented in libcrypto perform this check. Therefore, where a purpose is set the certificate chain will still be rejected even when the strict flag has been used. A purpose is set by default in libssl client and server certificate verification routines, but it can be overridden or removed by an application. In order to be affected, an application must explicitly set the X509_V_FLAG_X509_STRICT verification flag and either not set a purpose for the certificate verification or, in the case of TLS client or server applications, override the default purpose. OpenSSL versions 1.1.1h and newer are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1k. OpenSSL 1.0.2 is not impacted by this issue. Fixed in OpenSSL 1.1.1k (Affected 1.1.1h-1.1.1j).

CVSS 3.1 Base Score 7.4. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N).

CVSS 2.0 Base Score 5.8. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:P/I:P/A:N).

Demo Examples

Improper Certificate Validation

CWE-295

This code checks the certificate of a connected peer.


               
foo=SSL_get_verify_result(ssl);
// certificate looks good, host can be trusted

In this case, because the certificate is self-signed, there was no external authority that could prove the identity of the host. The program could be communicating with a different system that is spoofing the host, e.g. by poisoning the DNS cache or using a MITM attack to modify the traffic from server to client.

Improper Certificate Validation

CWE-295

The following OpenSSL code obtains a certificate and verifies it.


               
}
// do secret things

Even though the "verify" step returns X509_V_OK, this step does not include checking the Common Name against the name of the host. That is, there is no guarantee that the certificate is for the desired host. The SSL connection could have been established with a malicious host that provided a valid certificate.

Improper Certificate Validation

CWE-295

The following OpenSSL code ensures that there is a certificate and allows the use of expired certificates.


               
//do stuff

If the call to SSL_get_verify_result() returns X509_V_ERR_CERT_HAS_EXPIRED, this means that the certificate has expired. As time goes on, there is an increasing chance for attackers to compromise the certificate.

Improper Certificate Validation

CWE-295

The following OpenSSL code ensures that there is a certificate before continuing execution.


               
// got a certificate, do secret things

Because this code does not use SSL_get_verify_results() to check the certificate, it could accept certificates that have been revoked (X509_V_ERR_CERT_REVOKED). The software could be communicating with a malicious host.

Improper Certificate Validation

CWE-295

The following OpenSSL code ensures that the host has a certificate.


               
}
// got certificate, host can be trusted//foo=SSL_get_verify_result(ssl);//if (X509_V_OK==foo) ...

Note that the code does not call SSL_get_verify_result(ssl), which effectively disables the validation step that checks the certificate.

Overview

First reported 3 years ago

2021-03-25 15:15:00

Last updated 3 years ago

2021-10-20 11:17:00

Affected Software

OpenSSL Project OpenSSL

NetApp ONTAP Select Deploy Administration Utility

References

https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2a40b7bc7b94dd7de897a74571e7024f0cf0d63b

20210325 Multiple Vulnerabilities in OpenSSL Affecting Cisco Products: March 2021

https://www.openssl.org/news/secadv/20210325.txt

https://security.FreeBSD.org/advisories/FreeBSD-SA-21:07.openssl.asc

https://security.netapp.com/advisory/ntap-20210326-0006/

[oss-security] 20210327 OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

[oss-security] 20210327 Re: OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

[oss-security] 20210328 Re: OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

[oss-security] 20210328 Re: OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

[oss-security] 20210327 OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

Mailing List, Third Party Advisory

[oss-security] 20210327 Re: OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

Mailing List, Third Party Advisory

[oss-security] 20210328 Re: OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

Mailing List, Third Party Advisory

[oss-security] 20210328 Re: OpenSSL 1.1.1 CVE-2021-3450 CA certificate check bypass with X509_V_FLAG_X509_STRICT, CVE-2021-3449 NULL pointer deref in signature_algorithms processing

Mailing List, Third Party Advisory

https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2a40b7bc7b94dd7de897a74571e7024f0cf0d63b

Mailing List, Patch, Vendor Advisory

https://security.FreeBSD.org/advisories/FreeBSD-SA-21:07.openssl.asc

Third Party Advisory

GLSA-202103-03

Third Party Advisory

https://security.netapp.com/advisory/ntap-20210326-0006/

Third Party Advisory

20210325 Multiple Vulnerabilities in OpenSSL Affecting Cisco Products: March 2021

Third Party Advisory

https://www.openssl.org/news/secadv/20210325.txt

Vendor Advisory

FEDORA-2021-cbf14ab8f9

https://www.tenable.com/security/tns-2021-05

https://www.tenable.com/security/tns-2021-08

FEDORA-2021-cbf14ab8f9

Third Party Advisory

https://www.tenable.com/security/tns-2021-05

Third Party Advisory

https://www.tenable.com/security/tns-2021-08

Third Party Advisory

https://kc.mcafee.com/corporate/index?page=content&id=SB10356

https://mta.openssl.org/pipermail/openssl-announce/2021-March/000198.html

https://www.tenable.com/security/tns-2021-09

https://www.oracle.com/security-alerts/cpuApr2021.html

https://kc.mcafee.com/corporate/index?page=content&id=SB10356

Third Party Advisory

https://mta.openssl.org/pipermail/openssl-announce/2021-March/000198.html

Mailing List, Vendor Advisory

https://www.tenable.com/security/tns-2021-09

Third Party Advisory

https://www.oracle.com/security-alerts/cpuApr2021.html

Patch, Third Party Advisory

https://kb.pulsesecure.net/articles/Pulse_Security_Advisories/SA44845

https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0013

N/A

https://www.oracle.com/security-alerts/cpuoct2021.html

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.