Skip to content

Inadequate Encryption Strength

Description

The application is using an SSL module with SSL or TLS protocols that have known deficiencies. It is recommended to use TLS 1.2 or 1.3 and `SSLContext.wrap_socket`. The `pyOpenSSL` module is deprecated and should be replaced with the `pyca/cryptography` module.

Examples

Insecure Code

python
ssl.PROTOCOL_SSLv2

Secure Code

python
ssl.PROTOCOL_TLS_CLIENT

Remediation

Create a new TLS context and pass in `ssl.PROTOCOL_TLS_CLIENT` for clients or `ssl.PROTOCOL_TLS_SERVER` for servers to the `ssl.SSLContext(...)` `protocol=` argument. Use the new `SSLContext.wrap_socket` method instead.

Rule Details

FieldValue
IDCODE-0166
CategoryCrypto
SeverityMEDIUM
CWECWE-326
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsinadequate encryption, deprecated library
OWASPA3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures