SMTP Open Relay
The mail server accepts mail from any sender for any external recipient without authentication and passes it on, so others can send spam and phishing through it.
| Severity | High |
| CVSS 3.1 | 7.2 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:L Open in the calculator |
| CVSS 4.0 | 6.9 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N Open in the calculator |
| CWE | CWE-441: Unintended Proxy or Intermediary ('Confused Deputy') |
| OWASP Top 10 | A01:2025 Broken Access Control |
| MITRE ATT&CK | T1684.002 Email Spoofing, T1566 Phishing |
| Category | Security Misconfiguration |
Description
The SMTP server relays mail for anyone: it accepts messages from senders outside the organisation addressed to recipients outside the organisation, without requiring authentication, and passes them on. A mail server should accept unauthenticated mail only for the domains it is responsible for, and relay to other domains only for authenticated users or for specific internal systems such as applications and multifunction printers.
Anyone can then send spam, phishing and malware through the server, using the organisation's infrastructure and reputation. Because the messages come from the organisation's own mail server, they may pass sender checks such as SPF for the organisation's domain and so be more convincing to recipients, including the organisation's own staff and customers. Open relays exposed to the internet are found and abused quickly by automated scanning, and abuse typically leads to the server's addresses being placed on block lists, which stops legitimate mail from being delivered, and can bring complaints from recipients and providers. Relaying that is open only to internal networks is less serious than relaying open to the internet, but still lets any compromised internal host send mail through the server.
The issue is confirmed by connecting to the server from an untrusted network and sending a message from an external address to an external mailbox under the tester's control, then checking that it arrives; some servers accept the recipient during the SMTP conversation but discard the message later, so delivery is the reliable test. The Nmap smtp-open-relay script tries a range of address forms, including older tricks such as percent-hack and source-routed addresses that some servers mishandle.
Remediation
Allow relaying only for authenticated users and named internal systems:
- On Postfix, keep
smtpd_relay_restrictionsaspermit_mynetworks, permit_sasl_authenticated, defer_unauth_destination(the default) or withreject_unauth_destination, and make suremynetworkslists only trusted internal addresses. - On Microsoft Exchange, review receive connectors that accept anonymous connections: grant anonymous relay only on a dedicated connector whose remote IP ranges are limited to the specific systems that need it, never on the default internet-facing connector.
- On Sendmail, remove
RELAYentries for broad address ranges from the access database and do not use thepromiscuous_relayfeature; on Exim, limitrelay_from_hoststo trusted addresses. - For devices and applications that send mail, use authenticated submission on port 587 with TLS where they support it.
Check mail logs for signs that the relay has been abused, look up the server's addresses on public block lists, and request removal once the issue is fixed. Confirm the fix by repeating the relay test from an untrusted network, which should be refused, and by checking that internal applications can still send mail.
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 trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.