Skip to content

Unverified SSL Context

Description

The application creates a SSL context using the `_create_unverified_context` method, which disables the validation of server certificates. This allows an adversary to intercept potentially sensitive information or transmit malicious data.

Examples

Insecure Code

python
ssl._create_unverified_context()

Secure Code

python
ssl.create_default_context()

Remediation

Remove the call to `_create_unverified_context` and create a default context using `ssl.create_default_context` or create a context with TLS 1.3.

Rule Details

FieldValue
IDCODE-0167
CategoryCrypto
SeverityMEDIUM
CWECWE-295
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
Tagscertificate validation, SSL context
OWASPA2:2017-Broken Authentication, A07:2021-Identification and Authentication Failures