Cleartext Mail and Directory Protocols in Use

Mail or directory services accept logins over unencrypted connections, so user credentials and data such as email can be captured by anyone able to observe the traffic.

SeverityMedium
CVSS 3.15.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N Open in the calculator
CVSS 4.08.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-319: Cleartext Transmission of Sensitive Information
OWASP Top 10A04:2025 Cryptographic Failures
MITRE ATT&CKT1040 Network Sniffing, T1557 Adversary-in-the-Middle
CategoryCryptographic Failures

Description

One or more mail or directory services accept authentication without encryption. The protocols most often involved are POP3 (TCP port 110), IMAP (TCP port 143), authenticated SMTP mail submission (TCP ports 25 and 587) and LDAP simple binds (TCP port 389). In each case the user name and password are sent in plain text, or merely encoded in Base64 for the SMTP PLAIN and LOGIN mechanisms, and the messages or directory data that follow are also unencrypted. Many of these services support STARTTLS, but unless they require it before authentication, clients can still log in without it, and an attacker in the network path can remove the STARTTLS offer from the server's response.

An attacker who can observe traffic between clients and the service, for example from a compromised host on the same network segment, a shared wireless network or a device on the network path, can capture user names and passwords and read the mail or directory data exchanged. Mail clients and applications connect repeatedly with stored credentials, so passwords are exposed regularly without any action by the user. Mailbox and directory credentials are usually the user's main network credentials, and directory service accounts used by applications often have wide read access, so a single capture can lead to access well beyond the service itself.

The issue is identified by connecting to the service and checking whether authentication is offered or accepted before TLS: the capabilities a server advertises (CAPA for POP3, CAPABILITY for IMAP and EHLO for SMTP) show whether login is available on the unencrypted connection, and the Nmap pop3-capabilities, imap-capabilities and smtp-commands scripts report them. For LDAP, a simple bind attempted on port 389 without StartTLS shows whether it is accepted. Encryption of mail exchanged between mail servers, and LDAP signing on Active Directory, are separate matters.

Remediation

Require encryption before any authentication:

  • Offer the services over implicit TLS where clients support it (POP3S on port 995, IMAPS on port 993 and SMTP submission on port 465), or require STARTTLS before authentication on the standard ports.
  • On Dovecot, set ssl = required, which refuses authentication until TLS is in place. On Postfix, set smtpd_tls_auth_only = yes so that authentication is offered only after STARTTLS. On Microsoft Exchange, set the POP3 and IMAP login type to SecureLogin with Set-PopSettings and Set-ImapSettings, and allow basic authentication on receive connectors only after TLS has started.
  • For LDAP, use LDAPS on port 636 or require StartTLS, and configure the directory server to reject simple binds on unencrypted connections. On Active Directory, requiring LDAP signing causes simple binds over unencrypted connections to be rejected.
  • Update clients and applications to use the encrypted ports or STARTTLS, then close or restrict the unencrypted ports where they are no longer needed.
  • Change the passwords of accounts, particularly service accounts, that have been used over unencrypted connections.

Confirm the fix by attempting to authenticate on each unencrypted connection, which should be refused, and by checking with openssl s_client and its -starttls option that encrypted connections work.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding