Server certificate common name not checked
Description
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.
Risk
A malicious attacker might use a valid certificate to impersonate a trusted host, resulting in the client interacting with an untrusted server.
Fix
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
Examples
Result Information
Group: Cryptography |
Language: C | C++ |
Default: Off |
Command-Line Syntax:
CRYPTO_SSL_HOSTNAME_NOT_CHECKED |
Impact: Medium |
Version History
Introduced in R2020a
See Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)