Attacker might use valid certificate to impersonate trusted host
The defect occurs when you do not check the common name provided in the server certificate against the domain name of the server.
Typically, when a client connects to a server, the server sends a digital certificate to the client that identifies the server as a trusted entity. The certificate contains information about the server, including the common name of the server. The common name matches the server domain name that the certificate identifies as a trusted entity.
The checker raises no defect if:
You pass the SSL context as an argument to the function that calls
SSL_new.
You declare the SSL context outside the scope of the function handling the connection.
A malicious attacker might use a valid certificate to impersonate a trusted host, resulting in the client interacting with an untrusted server.
Use one of these functions to specify the server domain name that the program checks against the common name provided in the server certificate.
SSL_set_tlsext_host_name
SSL_set1_host
SSL_add1_host
| Group: Cryptography |
| Language: C | C++ |
| Default: Off |
Command-Line Syntax:
CRYPTO_SSL_HOSTNAME_NOT_CHECKED |
| Impact: Medium |
| CWE ID: 297 |