Exchange 2016 Unauthenticated Email Vulnerabilities (2023–2025)
CVEs Enabling Unauthenticated or Spoofed Email Sending
- CVE-2023-21709 (Exchange EoP via Auth Bypass): A critical Elevation of Privilege bug in Exchange 2016/2019 that lets an attacker “login as another user” without consent (Patch Tuesday - August 2023). Exploiting this NTLM-related flaw (CVSS 9.8) could allow an adversary to impersonate accounts and send mail on their behalf. Microsoft’s August 2023 patch for this required not just updating Exchange, but also running a PowerShell script (
CVE-2023-21709.ps1
) to fully enable the fix (Fixes For 6 Exchange Server Vulnerabilities Released In August HTMD Blog). Unpatched servers were at risk of attackers brute-forcing or bypassing auth to relay mail as trusted users (Patch Tuesday - August 2023). - CVE-2023-38181 and NTLM Relay Vulnerabilities: CVE-2023-38181 (Exchange 2016/2019 Spoofing) was an August 2023 patch for a patch-bypass chain of earlier Exchange flaws (Zero Day Initiative — The August 2023 Security Update Review). This issue (requiring initial authentication) allowed attackers to abuse Exchange’s backend processes to relay NTLM credentials and authenticate as another user (Zero Day Initiative — The August 2023 Security Update Review). In effect, a hacker could escalate privileges and even obtain a PowerShell remote session on the Exchange server (Zero Day Initiative — The August 2023 Security Update Review) – then use that access to inject emails into the transport pipeline without normal auth. Notably, this was a bypass of CVE-2023-32031 and CVE-2023-21529, which themselves were fixes for the ProxyNotShell exploit chain (CVE-2022-41040/41082) (Zero Day Initiative — The August 2023 Security Update Review). In short, attackers kept finding new ways to exploit Exchange’s serialization and authentication logic, enabling token impersonation and outbound mail spoofing if not fully patched.
- CVE-2024-21410 (Exchange NTLM Replay EoP): A February 2024 zero-day in Exchange 2016/2019 that was actively exploited in the wild (CVE-2024-21410 Archive - Greenbone). This flaw is an “authentication replay” or pass-the-hash attack on Exchange’s NTLM authentication (CVE-2024-21410 Archive - Greenbone). An unauthenticated attacker who tricks the Exchange server into authenticating to them (Net-NTLMv2) can capture that hash and replay it to elevate privileges on the Exchange system (CVE-2024-21410 Archive - Greenbone). Successful exploitation lets the threat actor impersonate an Exchange service account or user, gaining access to mailboxes and the ability to send emails as any user without a valid login (CVE-2024-21410 Archive - Greenbone) (CVE-2024-21410 Archive - Greenbone). Microsoft rushed out mitigations (Extended Protection updates and scripts) in the Nov 2023 SU and urged admins to enable Extended Protection to counter this (How to mitigate CVE-2024-21410 — Microsoft Exchange Server Elevation of Privilege Vulnerability – North American Servicing ) (How to mitigate CVE-2024-21410 — Microsoft Exchange Server Elevation of Privilege Vulnerability – North American Servicing ).
- CVE-2024-49040 (Exchange SMTP Spoofing Flaw): A high-severity spoofing vulnerability disclosed in Nov 2024 that remains unpatched (as of early 2025) but is mitigated by Exchange updates adding detection (Microsoft Exchange adds warning to emails abusing spoofing flaw). It exploits how Exchange parses certain email headers in the SMTP transport pipeline. By crafting a non-RFC-compliant “P2 From” header, an attacker can forge the sender address on an email so that Outlook displays a false sender as legitimate (Microsoft Exchange adds warning to emails abusing spoofing flaw). Essentially, Exchange’s transport would accept malformed sender fields that bypass proper verification, enabling spoofed messages that appear to come from trusted domains/users (Microsoft Exchange adds warning to emails abusing spoofing flaw). Microsoft’s Nov 2024 update doesn’t fix the parsing bug, but adds a warning banner and an
X-MS-Exchange-P2FromRegexMatch
header to any email exploiting this, so admins can identify or block the spoof (Microsoft Exchange adds warning to emails abusing spoofing flaw). (This issue was discovered by V. Kokorin and affects Exchange 2016/2019 (Microsoft Exchange adds warning to emails abusing spoofing flaw).)
Case Studies and Incident Reports
- ProxyShell & ProxyNotShell Exploits (2021–2022): Earlier exploit chains like ProxyShell (2021) demonstrated the danger of Exchange transport flaws. ProxyShell combined three bugs (CVE-2021-34473, 34523, 31207) to achieve pre-auth remote code execution (RCE) on Exchange 2016 (PST, Want a Shell? ProxyShell Exploiting Microsoft Exchange Servers | Google Cloud Blog) (PST, Want a Shell? ProxyShell Exploiting Microsoft Exchange Servers | Google Cloud Blog). Attackers worldwide (e.g. UNC2980 in a university attack) used this to compromise servers and then sent malicious emails from those servers (PST, Want a Shell? ProxyShell Exploiting Microsoft Exchange Servers | Google Cloud Blog) (PST, Want a Shell? ProxyShell Exploiting Microsoft Exchange Servers | Google Cloud Blog). In 2022, ProxyNotShell (CVE-2022-41040/41082) – an SSRF plus RCE – was similarly used to hijack Exchange 2016 servers. Once RCE was gained via these exploits, attackers often installed web shells or ran Exchange Management shells to send spam/phishing emails directly from the Exchange server, effectively bypassing normal authentication (since the server itself was sending the mail). These incidents underscored that even fully patched Exchange environments needed continuous monitoring, as exploit code often leveraged the Exchange transport pipeline to propagate malicious emails internally.
- NTLM Relay Attacks by APT Groups (2023): In 2023, threat actors (including nation-state groups) targeted Exchange’s authentication weaknesses. For example, APT28 (a Russian state-linked group) was observed exploiting NTLM relay vulnerabilities like CVE-2024-21410 to steal Exchange authentication tokens and impersonate users (CVE-2024-21410 Archive - Greenbone). This allowed them to read confidential emails and even send messages as high-privilege users, all without valid credentials. CISA reported that CVE-2024-21410 was under active attack (added to the KEV catalog) (CVE-2024-21410 Archive - Greenbone), meaning multiple incidents where on-prem Exchange servers were breached. In these cases, Exchange servers became launch pads for further phishing or data theft – attackers authenticating as the Exchange server itself and then interacting with mailboxes or sending outbound mail as if it were legitimate system activity.
- Exchange Server as a Spam Relay (Real Incidents): There have been reports of Exchange 2016 servers suddenly sending outbound spam or phish without any user account being obviously compromised. In one Spiceworks forum case, an admin found their Exchange sending emails to all users from what looked like internal accounts. The message headers showed an
X-ClientProxiedBy
line with the Exchange server’s own name/IP “To” itself (127.0.0.1) – indicating the message was injected locally on the server (Email account compromised and keeps getting flooded - Collaboration). This kind of artifact is a red flag: it suggests the SMTP pipeline was triggered internally (possibly by malware or a web shell on the server) rather than by a user logging in via Outlook. Microsoft’s incident guidance notes that once attackers gain Exchange SYSTEM access, they can directly submit emails into transport using PowerShell or pickup directories, leading to outbound messages that bypass normal auth logging. Such messages often show only the Exchange server (localhost) in Received headers. (For example, Exchange’s own health probe emails originate from 127.0.0.1 as seen in headers (Undeliverable Inbound proxy probe message troubleshoot - Microsoft Q&A) – an attacker can abuse similar internal channels to send mail.)
Behavioral Notes: Proxied Traffic & Header Indicators
- Headers Showing Localhost (127.0.0.1): When Exchange’s Frontend Transport proxies SMTP connections to the backend, it can stamp headers like
Received: from <source> (127.0.0.1) by <server>
or add anX-ClientProxiedBy
header. For instance, Exchange health monitoring will generate an InboundProxyProbe message from 127.0.0.1, with headers such as “Received: from InboundProxyProbe (127.0.0.1) by ExchangeServer (127.0.0.1)” (Undeliverable Inbound proxy probe message troubleshoot - Microsoft Q&A). In a healthy scenario, these originate from HealthMailbox accounts and are benign. However, if you find outbound emails with similar headers (localhost as the sending host) that are not from a health mailbox, it may indicate that the email was injected internally. In other words, the Exchange server itself (or a process on it) acted as the client. This is typical in exploits where the attacker runs code on the server – the malicious email is submitted locally, so no external IP shows up. - X-ClientProxiedBy Header: This header explicitly notes an Exchange Frontend server proxying an SMTP session to a Mailbox server. In single-server environments it might show the same server twice (proxy to itself). For example: “X-ClientProxiedBy: ExchServer.LOCAL (192.168.10.13) To ExchServer.LOCAL (192.168.10.13)” (Email account compromised and keeps getting flooded - Collaboration). In Office 365, admins sometimes use this header to spot spoofing or strange routing (o365 Journal Spoofing -- X-ClientProxiedBy header can be used for). In on-prem Exchange 2016, seeing your server’s name/IP in both the proxy “By” and “To” fields for an outbound message could mean the message didn’t come from an authenticated client at all – it was accepted by the frontend from an internal source. When investigating suspicious emails, lack of an authenticated sender and presence of localhost in headers are strong signs of an email sent via a backend process rather than a user login. This aligns with vulnerabilities that allow transport-level abuse: e.g. an NTLM relay attack might make the Exchange server trust the connection as internal, resulting in a proxied-by-localhost header and the email getting sent out without an auth event.
- No User Authentication in Logs: Environments hit by these vulnerabilities often find that outbound malicious emails do not correspond to any user’s SMTP login in the logs. That’s because exploits like token replay or EWS-based attacks leverage service contexts. For instance, CVE-2023-38181’s NTLM relay could make Exchange accept a message as if it were coming from the Exchange server itself (Exchange believes it’s just routing internal system traffic) (Zero Day Initiative — The August 2023 Security Update Review). Similarly, after an attacker gains SYSTEM-level access (via RCE), they can call Exchange’s send-mail APIs or drop emails into the pickup folder, which bypasses authentication. The result is outbound mail that Exchange delivers (often successfully) but doesn’t attribute to any mailbox login – the only trace is in message tracking or headers showing the server as the source. Administrators should look for anomalies like messages with
X-MS-Exchange-Organization-AuthAs: Internal
despite not being sent by a known application account, or unexpectedX-ClientProxiedBy
entries, as these often accompany spoofed or unauthenticated deliveries from compromised Exchange servers.
References
- Microsoft & NVD Advisories for Exchange 2016/2019 CVEs (Patch Tuesday - August 2023) (CVE-2024-21410 Archive - Greenbone) (Microsoft Exchange adds warning to emails abusing spoofing flaw)
- Security research analyses by Zero Day Initiative (Trend Micro) on Exchange exploit chains (Zero Day Initiative — The August 2023 Security Update Review)
- Microsoft Exchange Team and MSRC guidance on mitigating NTLM relay attacks (Extended Protection) (How to mitigate CVE-2024-21410 — Microsoft Exchange Server Elevation of Privilege Vulnerability – North American Servicing ) (CVE-2024-21410 Archive - Greenbone)
- Real-world examples of Exchange exploit effects (Mandiant case study, Spiceworks forums) (PST, Want a Shell? ProxyShell Exploiting Microsoft Exchange Servers | Google Cloud Blog) (Email account compromised and keeps getting flooded - Collaboration) (Undeliverable Inbound proxy probe message troubleshoot - Microsoft Q&A)
- BleepingComputer news on Exchange spoofing flaw CVE-2024-49040 (Microsoft Exchange adds warning to emails abusing spoofing flaw) and Microsoft’s response.