Skip to content

Insecure SMTP SSL Configuration

Description

Server identity verification is disabled when making SSL connections, which can lead to man-in-the-middle attacks.

Examples

Insecure Code

scala
val email = new SimpleEmail(); email.setSSLOnConnect(true);

Secure Code

scala
val email = new SimpleEmail(); email.setSSLOnConnect(true); email.setSSLCheckServerIdentity(true);

Remediation

Enable server identity verification by calling setSSLCheckServerIdentity(true) on the email object after setting SSLOnConnect to true.

Rule Details

FieldValue
IDCODE-0065
CategoryInsecureConfig
SeverityHIGH
CWECWE-297
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityMODERATE
TagsSMTP, SSL, TLS
OWASPA2:2017-Broken Authentication, A07:2021-Identification and Authentication Failures