In 2021 two chains of vulnerabilities in on-premises Exchange Server, ProxyLogon and ProxyShell, turned internet-facing mail servers into one of the most widely exploited entry points of the year. Both chains let an unauthenticated attacker reach code execution on a server that most organisations had published directly to the internet, and in both cases mass exploitation followed disclosure within days or weeks. This guide profiles the seven CVEs involved, the 2021 timeline, the US government response including CISA Emergency Directive 21-02, and the lessons that still apply to anyone running Exchange on premises: patch cadence, exposure reduction and web shell hunting. It is written for Exchange administrators, vulnerability managers and incident responders, and it is defensive only. For the full Exchange hardening baseline, see the Microsoft Exchange Server Security Guide.
Key takeaways
- Two chains, one lesson. ProxyLogon (four CVEs, disclosed 2 March 2021) and ProxyShell (three CVEs, fixed by the May 2021 updates) both started with an unauthenticated request to a published Exchange endpoint.
- Patching was necessary but not sufficient. CISA told organisations to investigate for compromise back to 1 January 2021, because servers patched after exploitation could still carry web shells.
- Assume identity compromise if exploited. CISA's advisory said that where exploitation is found, organisations should assume network identity compromise, because Exchange servers hold highly privileged Active Directory rights.
- Exposure is a choice. Restricting external access to
/owa/and/ecp/, putting a deny-by-default firewall in front of Exchange and removing the admin centre from the internet shrink the attack surface for the next chain too. - Currency is the control. The government hardening list required security updates within 48 hours of release and only vendor-supported versions; servers that fall behind on cumulative updates cannot receive security fixes at all.
At a glance
| Item | ProxyLogon | ProxyShell |
|---|---|---|
| CVEs | CVE-2021-26855, CVE-2021-26857, CVE-2021-26858, CVE-2021-27065 | CVE-2021-34473, CVE-2021-34523, CVE-2021-31207 |
| Public disclosure | 2 March 2021, out-of-band security updates | CVE-2021-31207 published 11 May 2021; CVE-2021-34473 and CVE-2021-34523 published 14 July 2021 |
| Fix | March 2021 out-of-band updates | CISA: the May 2021 security update fixes all three |
| Products | On-premises Exchange Server; Exchange Online not affected | On-premises Exchange Server 2013, 2016 and 2019 |
| Entry point | Unauthenticated request processed by the Client Access front end | Unauthenticated request to a published Exchange endpoint |
| Typical result | Web shells, credential dumping, mailbox theft, ransomware | Web shells and follow-on intrusion |
| CISA KEV | All four added 3 November 2021, known ransomware use | All three added 3 November 2021, known ransomware use |
What happened in 2021
On 2 March 2021 Microsoft released out-of-band security updates for on-premises Exchange Server and published an analysis attributing exploitation, with high confidence, to HAFNIUM, a group it assessed as state-sponsored and operating out of China. Microsoft now tracks that group as Silk Typhoon; see the Silk Typhoon Threat Actor Profile Guide for the actor's later activity. Other actors began exploiting the same flaws soon after disclosure, which is why the response moved from targeted intrusion to mass remediation.
- 2 March 2021: Microsoft releases out-of-band updates for the four ProxyLogon CVEs and publishes detection guidance. Exchange Online is not affected.
- 3 March 2021: CISA issues Emergency Directive 21-02 for federal civilian agencies and advisory AA21-062A for everyone else, recommending investigation from 1 January 2021.
- March 2021: CISA updates the advisory repeatedly, adding China Chopper web shell malware analysis reports, YARA rules, Microsoft's Test-ProxyLogon.ps1 and the Exchange On-premises Mitigation Tool, and a report on DearCry ransomware used against compromised Exchange servers.
- 31 March 2021: CISA's supplemental direction requires agencies to run Test-ProxyLogon.ps1 and the Microsoft Safety Scanner (MSERT), and sets a hardening list due by 28 June 2021.
- 13 April 2021: Microsoft's April security update discloses and fixes further Exchange vulnerabilities and adds Exchange Server 2013 to the affected list; CISA directs agencies to deploy it by 16 April 2021. The same day the US Department of Justice announces a court-authorised FBI operation that removed one early group's web shells from hundreds of US servers, without patching them or removing other malware.
- 11 May 2021: CVE-2021-31207 is published with the May 2021 security update.
- 14 July 2021: CVE-2021-34473 and CVE-2021-34523 are published; with CVE-2021-31207 they form the ProxyShell chain.
- 21 August 2021: CISA warns that threat actors are actively exploiting ProxyShell and urges organisations to identify vulnerable systems and install the May 2021 update.
- 3 November 2021: All seven CVEs are added to the CISA Known Exploited Vulnerabilities catalogue, marked as known to be used in ransomware campaigns.
The CVEs involved
The descriptions below are at the level Microsoft and the CVE records publish them. They explain why the chains were dangerous without describing how to exploit them. CVSS scores are the CNA (Microsoft) scores in the CVE records.
| CVE | Chain | Microsoft title | Nature | CVSS 3.1 |
|---|---|---|---|---|
| CVE-2021-26855 | ProxyLogon | Remote Code Execution | Server-side request forgery that let an attacker send arbitrary HTTP requests and authenticate as the Exchange server | 9.1 |
| CVE-2021-26857 | ProxyLogon | Remote Code Execution | Insecure deserialisation in the Unified Messaging service, code as SYSTEM; needs admin rights or another flaw | 7.8 |
| CVE-2021-26858 | ProxyLogon | Remote Code Execution | Post-authentication arbitrary file write | 7.8 |
| CVE-2021-27065 | ProxyLogon | Remote Code Execution | Post-authentication arbitrary file write | 7.8 |
| CVE-2021-34473 | ProxyShell | Remote Code Execution | Remote code execution; with the next two CVEs forms the ProxyShell chain | 9.1 |
| CVE-2021-34523 | ProxyShell | Elevation of Privilege | Privilege escalation within Exchange | 9.0 |
| CVE-2021-31207 | ProxyShell | Security Feature Bypass | Security feature bypass; the third ProxyShell CVE, rated lower on its own | 6.6 |
The pattern matters more than the individual bugs. The two post-authentication file write flaws were only reachable because the server-side request forgery provided authentication; the ProxyShell flaws were similarly chained. A single medium-rated CVE in a chain can be the step that turns access into code execution, so rate chains by their combined effect, not by the highest individual score. The Risk-Based Vulnerability Management Guide covers how to weight known exploitation and exposure.
Who was affected
- Products: on-premises Exchange Server. The CVE records for the ProxyLogon flaws list Exchange Server 2013, 2016 and 2019 cumulative updates, with CVE-2021-26857 also listing Exchange Server 2010 Service Pack 3. The ProxyShell records list Exchange 2013 CU23, 2016 CU19 and CU20, and 2019 CU8 and CU9. Microsoft and CISA both stated that Exchange Online was not affected by ProxyLogon.
- Exposure: any server with Outlook on the web, the Exchange admin centre or other Client Access endpoints published to the internet. Hybrid deployments that kept an on-premises server for management or mail routing were in scope too.
- Organisations: the initial campaign was targeted, but mass exploitation followed. The Justice Department said hundreds of web shells had persisted unmitigated on US servers by April 2021, which shows how many owners had patched without checking for compromise, or had not patched at all.
- Follow-on threats: CISA reported DearCry ransomware against compromised Exchange servers, and the KEV catalogue marks all seven CVEs as known to be used in ransomware campaigns.
Patching and mitigation
Microsoft's own tooling states the principle plainly: installing the applicable Exchange Server security update is the only way to fully protect a server, and URL Rewrite mitigations are a temporary measure. Treat every mitigation below as a bridge to patching, not a substitute.
- Know your build: run Microsoft's Exchange Server Health Checker on every server to confirm the build, cumulative update and security update level. Security updates are released only for supported cumulative updates, so a server two CUs behind cannot be patched until it is brought current.
- Stay on supported versions: Exchange Server 2016 and 2019 reached the end of extended support on 14 October 2025. Plan migration to Exchange Server Subscription Edition or Exchange Online; see the Exchange Server 2016 and 2019 End of Support guide.
- Patch to a deadline: the 2021 federal hardening list required security and cumulative updates within 48 hours of release. Few organisations meet that for every system, but internet-facing Exchange is the case for it.
- Use interim mitigations while you patch: Microsoft's Exchange On-premises Mitigation Tool applies IIS URL Rewrite mitigations for listed CVEs, including CVE-2021-26855, with WhatIf preview and JSON-backed rollback. The Exchange Emergency Mitigation service applies Microsoft-published mitigations automatically on supported builds; its configuration is covered in the Exchange Server Security Guide.
- Reduce exposure: CISA recommended limiting or blocking external access to internet-facing Exchange, including the
/owa/and/ecp/URLs, and disconnecting servers that could not be patched. Publish only what users need, through a reverse proxy or pre-authenticating gateway, and never publish the admin centre. - Harden around the server: the CISA hardening list added a deny-by-default firewall between Exchange and the internet, review of Exchange accounts, groups and Active Directory permissions (no Exchange account in Domain Admins), at least 180 days of centrally retained logs, and current anti-malware signatures.
- Roll back safely: stage security updates on one server in a database availability group first, confirm mail flow and client access, then proceed. Keep the mitigation tool's rollback files so URL Rewrite rules can be removed once patched.
Choosing between options
| Situation | Best option | Trade-off |
|---|---|---|
| Server current on supported CU | Install the security update now, then hunt | Short maintenance window per server |
| Server behind on CUs | Apply URL Rewrite mitigation, restrict external access, then update CU and security update | Mitigations cover only listed CVEs |
| Unsupported version | Remove from internet exposure, migrate | Migration effort; no security fixes in the meantime |
| Signs of compromise | Isolate, preserve evidence, rebuild rather than clean | Downtime; needs identity remediation |
| Small organisation with no Exchange specialist | Consider moving mailboxes to Exchange Online and removing the published server | A hybrid management server may still be needed and must be patched |
Detection and defence
CISA's guidance was explicit that a lack of matching indicators does not prove a server is clean, because attackers used short-lived infrastructure. Hunt for behaviour and artefacts, not only for published IP addresses and hashes. The detailed method is in How to Hunt for Web Shells on IIS, Apache and Nginx; the points below are the Exchange-specific ones from the 2021 advisories.
- Web shell locations: CISA listed
\inetpub\wwwroot\aspnet_client\and theFrontEnd\HttpProxy\owa\auth\andFrontEnd\HttpProxy\ecp\auth\folders as places to check for new or modified .aspx files. Baseline these folders and alert on any change outside a patch window. - Exchange logs: Microsoft's detection guidance pointed to the HttpProxy logs (unauthenticated requests with unusual anchor mailbox values), the ECP server logs (
Set-*VirtualDirectoryentries containing script), the OAB generator logs (files written outside the expected temp folder) and Application event log errors from the MSExchange Unified Messaging source. - Microsoft scripts: Test-ProxyLogon.ps1 automates the four checks from Microsoft's analysis and flags archive files in
C:\ProgramData\, which attackers used to stage data. Run it across all servers with its output saved for the incident record. - Process behaviour: alert when the IIS worker process
w3wp.exespawns command shells or PowerShell, and on any access to LSASS memory on an Exchange server. Microsoft observed LSASS dumping with Procdump and mailbox export through Exchange PowerShell snap-ins. - Identity signals: watch for new accounts, new members of Exchange and Active Directory privileged groups, and mailbox export requests. Exchange servers have broad directory rights, so treat them as Tier 0; see the Web Shell Response Playbook for containment.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1190 Exploit Public-Facing Application | Initial access through the Exchange front end |
| MITRE ATT&CK | T1505.003 Web Shell | China Chopper and other ASPX web shells for persistence |
| MITRE ATT&CK | T1003.001 LSASS Memory | Credential dumping after compromise |
| MITRE ATT&CK | T1114 Email Collection; T1560.001 Archive via Utility | Mailbox export and data staged in archives |
| MITRE D3FEND | D3-SU Software Update; D3-FA File Analysis | Patching and inspection of files written to web folders |
| NIST SP 800-53 Rev 5 | SI-2, RA-5, CM-8, SC-7, SI-4, AU-6, IR-4 | Flaw remediation, scanning, inventory, boundary protection, monitoring, incident handling |
| NIST CSF 2.0 | ID.AM-02, ID.RA-01, PR.PS-02, DE.CM-09 | Know what runs, find vulnerabilities, maintain software, monitor for adverse events |
| CIS Controls v8.1 | Control 7 Continuous Vulnerability Management; Control 13 Network Monitoring and Defense | Patch cadence and monitoring of exposed services |
| ISO/IEC 27001:2022 | A.8.8 Management of technical vulnerabilities; A.8.16 Monitoring activities | Vulnerability handling and monitoring |
Metrics that show it is working
- Time to patch internet-facing Exchange: days from security update release to installation on every exposed server, against a target such as 48 hours.
- CU currency: share of servers on a cumulative update that still receives security updates (target 100%).
- Exposed endpoints: number of Exchange virtual directories reachable from the internet, with the admin centre at zero.
- Web folder integrity: unexplained file changes in Exchange web folders per month, each investigated.
- Log coverage: share of Exchange servers sending IIS, HttpProxy and ECP logs to the SIEM with at least 180 days retention.
Common failure patterns
- Patching without hunting: the April 2021 FBI operation found hundreds of web shells still in place, so servers that were patched after compromise stayed compromised.
- Falling behind on cumulative updates: organisations that could not apply a security update because their CU was unsupported lost days while they upgraded under pressure.
- Cleaning instead of rebuilding: removing a web shell does not remove accounts, scheduled tasks or credentials the attacker created; ED 21-02 kept compromised servers off the domain until a rebuild.
- Forgetting the identity layer: failing to reset credentials and review Exchange's Active Directory permissions after an LSASS dump leaves the attacker able to return.
- Relying on indicator lists: treating "no IOC matches" as clean, against CISA's explicit warning.
Practitioner checklist
- Inventory every Exchange server, including hybrid management servers, with its build, CU and internet exposure.
- Confirm every server is on a supported version and CU, and record the date of its last security update.
- Remove the Exchange admin centre and any unneeded virtual directories from internet exposure.
- Put a pre-authenticating proxy or deny-by-default firewall in front of published endpoints.
- Run Health Checker after every update and track findings to closure.
- Baseline Exchange web folders and alert on new or modified .aspx files.
- Send IIS, HttpProxy, ECP and Windows event logs to the SIEM with at least 180 days retention.
- Alert on
w3wp.exespawning shells and on LSASS access on Exchange servers. - Remove Exchange accounts from Domain Admins and review Exchange's Active Directory permissions.
- Agree in advance that a compromised Exchange server is rebuilt, and rehearse the credential reset that follows.
Standards and references
- CISA: Emergency Directive 21-02 Mitigate Microsoft Exchange On-Premises Product Vulnerabilities
- CISA: AA21-062A Mitigate Microsoft Exchange Server Vulnerabilities
- CISA: Urgent: Protect Against Active Exploitation of ProxyShell Vulnerabilities
- Microsoft Security: HAFNIUM targeting Exchange Servers with 0-day exploits
- US Department of Justice: Court-authorised effort to disrupt exploitation of Microsoft Exchange Server vulnerabilities
- Microsoft: CSS-Exchange scripts (Test-ProxyLogon, Health Checker, EOMT)
- CVE Program: CVE-2021-34473 record
- CISA: Known Exploited Vulnerabilities Catalog
Related NHI Mgmt Group resources: Microsoft Exchange Server Security Guide · Silk Typhoon Threat Actor Profile Guide · How to Hunt for Web Shells on IIS, Apache and Nginx · Vulnerability Management Guide · Web Shell Response Playbook