Nonsecure SSL/TLS protocol
Context used for handling SSL/TLS connections is associated with weak protocol
Description
This defect occurs when you do not
disable nonsecure protocols in an SSL_CTX
or SSL
context object before using the object for handling SSL/TLS connections.
For instance, you disable the protocols SSL2.0 and TLS1.0 but forget to disable the protocol SSL3.0, which is also considered weak.
/* Create and configure context */ ctx = SSL_CTX_new(SSLv23_method()); SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_TLSv1); /* Use context to handle connection */ ssl = SSL_new(ctx); SSL_set_fd(ssl, NULL); ret = SSL_connect(ssl);
Risk
The protocols SSL2.0, SSL3.0, and TLS1.0 are considered weak in the cryptographic community. Using one of these protocols can expose your connections to cross-protocol attacks. The attacker can decrypt an RSA ciphertext without knowing the RSA private key.
Fix
Disable the nonsecure protocols in the context object before using the object to handle connections.
/* Create and configure context */ ctx = SSL_CTX_new(SSLv23_method()); SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1);
Examples
Result Information
Group: Cryptography |
Language: C | C++ |
Default: Off |
Command-Line Syntax:
CRYPTO_SSL_WEAK_PROTOCOL |
Impact: Medium |
Version History
Introduced in R2018a
See Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)