Vulnerability2 Mar 2021

ProxyLogon (Microsoft Exchange)

Four zero-days let attackers take over on-premises Exchange servers. After the patch, mass exploitation hit about 250,000.

Severity
History books
Difficulty
intermediate
Companies
Microsoft, DEVCORE, Volexity
Tech
Microsoft Exchange, SSRF, Web shells, Deserialization
Root cause
injection / unsafe parsing, unpatched flaw

The story

Quick (1 min)

On 2 March 2021, Microsoft released emergency fixes for four zero-day vulnerabilities in Exchange Server, the email server many organisations run themselves. Attackers were already using them.

Chained together, the flaws let an attacker on the internet pretend to be the server itself, write files anywhere on it, and plant a web shell: a hidden backdoor page they could visit later to run commands. From there they could read every mailbox.

Microsoft blamed a China-based state group it calls HAFNIUM. Once the patch came out, many more groups rushed to attack servers that hadn't updated. By 9 March, an estimated 250,000 servers had been hit, many at small businesses and local governments.

The lesson: internet-facing servers you run yourself need fast patching, and patching doesn't remove a backdoor that's already been planted.

Keep reading to the end to earn XP.Read. XP earned.

Engineer (2 min)

The chain (from Microsoft's analysis):

  • CVE-2021-26855, server-side request forgery (SSRF): lets an attacker "send arbitrary HTTP requests and authenticate as the Exchange server." This is the unauthenticated entry point, later widely called ProxyLogon.
  • CVE-2021-26857, insecure deserialization in Unified Messaging: run code as SYSTEM. It needs admin permission or another vulnerability.
  • CVE-2021-26858 and CVE-2021-27065, post-authentication arbitrary file writes: write a file to any path, reached either through the SSRF or with stolen admin credentials.

Post-exploitation. Attackers dropped web shells (ASP pages) and then, per Microsoft, dumped LSASS memory with Procdump to harvest credentials, compressed stolen data with 7-Zip, exported mailboxes with Exchange PowerShell snap-ins, and opened reverse shells.

Scope. Exchange Server 2010, 2013, 2016 and 2019 (on-premises). Exchange Online was not affected.

From targeted to mass exploitation. Microsoft first saw "limited and targeted attacks." After the patch, ESET observed multiple groups exploiting it, and proof-of-concept code appeared within about ten days. Ransomware followed (Microsoft reported a new family on 12 March).

Why patching wasn't enough. Updating closed the holes but didn't remove web shells or other backdoors. Defenders had to hunt for indicators of compromise and clean up.

Interview takeaway: SSRF that lets you act as the server is often the first link in a critical chain. Reduce internet exposure of admin-heavy servers, patch on emergency timelines, and assume compromise when exploitation came before the patch.

Keep reading to the end to earn XP.Read. XP earned.

Deep dive (2 min)

Timeline (Wikipedia, Microsoft)

  • 5 January 2021: security firm DEVCORE reports the vulnerability to Microsoft; confirmed on 8 January.
  • 6 January 2021: Volexity detects the first known breach of an Exchange server.
  • Late January: Volexity sees data theft from two customers and reports to Microsoft. Attackers become less discreet in anticipation of a patch.
  • 2 March 2021: Microsoft releases security updates for Exchange 2010–2019 and publishes its HAFNIUM analysis. ESET reports multiple threat actors exploiting the flaws.
  • 3 March 2021: CVE-2021-26855 published in NVD.
  • 9 March 2021: an estimated 250,000 servers compromised.
  • 10 March 2021: proof-of-concept code is posted to GitHub and removed the same day. Another group publishes exploit code on 13 March.
  • 12 March 2021: Microsoft announces a new ransomware family deployed on compromised servers.
  • 22 March 2021: Microsoft says 92% of Exchange servers are patched or mitigated.
  • 3 November 2021: CVE-2021-26855 added to CISA's Known Exploited Vulnerabilities catalogue (NVD).

Attribution

Microsoft attributed the initial campaign "with high confidence to HAFNIUM, a group assessed to be state-sponsored and operating out of China." It described HAFNIUM as primarily targeting US entities: infectious disease researchers, law firms, universities, defence contractors, think tanks and NGOs. China's government denied involvement (Wikipedia).

Who got hurt most

Wikipedia notes small and medium businesses, local institutions and local governments were the primary victims. They often have smaller security budgets and outsourced IT.

Microsoft's guidance

"We strongly urge customers to update on-premises systems immediately."

Microsoft also published indicators of compromise and hunting queries so organisations could check whether they had already been breached.

Severity

NVD rates CVE-2021-26855 at CVSS 3.1 base score 9.1.

Keep reading to the end to earn XP.Read. XP earned.

Failure replay

Step by step, what broke and what it hit next.

  1. Jan 2021
    Exchange serverdegraded

    On-premises Exchange exposes an SSRF flaw. DEVCORE reports it on 5 January; exploitation begins the next day.

  2. Attack
    Attackercompromised

    An unauthenticated attacker sends crafted HTTP requests that make Exchange authenticate as itself (CVE-2021-26855).

    Affects: Exchange server

  3. Attack
    Exchange servercompromised

    Using that access, the attacker abuses the file-write bugs to drop an ASP web shell into a web-accessible folder.

    Affects: Web shell

  4. Attack
    Web shellcompromised

    Through the web shell, attackers dump LSASS for credentials, export mailboxes and open reverse shells.

    Affects: Mailboxes and network

  5. Mar 2, 2021
    Exchange serverrecovering

    Microsoft ships emergency patches. Exchange Online is not affected.

  6. Mar 2–13
    Attackercompromised

    Many groups race to exploit unpatched servers. Exploit code appears and ransomware follows.

    Affects: Mailboxes and network

  7. By Mar 9
    Mailboxes and networkcompromised

    An estimated 250,000 servers are compromised, many at small businesses and local governments.

  8. Mar 22
    Exchange serverrecovering

    92% of servers are patched or mitigated, but backdoors already planted must be hunted down separately.

Impact

Who was affected
Organisations running on-premises Exchange Server 2010–2019; an estimated 250,000 servers compromised by 9 March 2021, especially small and medium businesses and local governments.
How long
Exploitation from about 6 January 2021; patches on 2 March; mass exploitation continued for weeks until most servers were patched (92% by 22 March).
Cost
not disclosed

Lessons

  • Internet-facing, self-managed servers need emergency patch processes measured in hours.
  • Patching doesn't remove web shells; when exploitation predates the patch, assume compromise and hunt.
  • SSRF that lets requests act as the server is often the first link in a critical chain.
  • Once a patch is public, attackers reverse engineer it quickly; the window closes fast.
  • Consider managed services when you can't patch at the speed attackers move.

Quiz

  1. Which vulnerability gave unauthenticated attackers their first foothold?

    Check answer

    CVE-2021-26855 server-side request forgery. The SSRF let attackers send requests that authenticated as the Exchange server, enabling the rest of the chain.

  2. What did attackers typically install after exploiting the flaws?

    Check answer

    Web shells that gave them ongoing remote access. Microsoft observed ASP web shells being deployed, followed by credential dumping and data theft.

  3. Was Exchange Online affected?

    Check answer

    No; only on-premises Exchange Server was affected. Microsoft stated Exchange Online was not affected.

  4. Why wasn't patching enough for organisations already attacked?

    Check answer

    Patching didn't remove backdoors such as web shells installed before the update. Attackers' backdoors stayed until found and removed, so organisations had to hunt for compromise.

Interview prep

Try answering out loud before you open the model answer.

  1. security

    What is server-side request forgery (SSRF), and why was it so dangerous in the Exchange ProxyLogon chain?

    Show model answer

    SSRF lets an attacker make a server send requests on their behalf, often to internal endpoints the attacker can't reach directly, carrying the server's identity. In Exchange, CVE-2021-26855 let unauthenticated attackers send arbitrary HTTP requests that authenticated as the Exchange server itself. That bypassed authentication and unlocked the post-authentication file-write bugs, leading to web shells and full compromise. Defences: strict validation and allow-listing of backend targets, not trusting internal requests implicitly, network segmentation, and fast patching.

    A strong answer hits:

    • SSRF definition
    • Request acts with the server's identity
    • Chained to post-auth file write and web shell
    • Allow-listing, zero-trust internal calls, patching
  2. system design

    A critical zero-day in your internet-facing mail server was exploited for weeks before the patch. What is your response plan beyond patching?

    Show model answer

    Patch immediately, or mitigate if you can't (block or restrict external access). Assume compromise: hunt using vendor indicators and queries for web shells, unexpected files, LSASS dumps and odd PowerShell activity. If compromised, isolate the server, preserve evidence, remove backdoors or rebuild, and reset credentials that may have been harvested (domain admin, service accounts). Review mailbox export logs to scope data theft and meet legal notification duties. Afterwards, reduce exposure and speed up patching.

    A strong answer hits:

    • Patch or mitigate first
    • Assume compromise and hunt with IOCs
    • Rebuild and credential reset
    • Scope data theft and notify
  3. behavioural

    Many small organisations couldn't patch Exchange quickly. If you advised a small business, what would you recommend?

    Show model answer

    Be honest about capacity. If they can't patch critical internet-facing systems within days, a managed service (Exchange Online wasn't affected) moves that burden to a provider. If they stay on-premises, put the server behind a VPN or reverse proxy, subscribe to vendor advisories, set up automatic updates where possible, and arrange emergency support with their IT provider. Keep backups and an incident plan.

    A strong answer hits:

    • Match responsibilities to capacity
    • Managed services as risk transfer
    • Reduce exposure (VPN, proxy)
    • Advisories, emergency support, backups

Go deeper