CVE-2023-21529: Microsoft Exchange Server RCE via Untrusted Deserialization
Technical Analysis
Section titled “Technical Analysis”The core of this vulnerability lies in the insecure deserialization of data within the Exchange Server environment. In .NET applications, deserialization is the process of converting a byte stream back into an object. When an application deserializes data from an untrusted source without sufficient validation, an attacker can craft a malicious payload (often using gadgets from available libraries) that triggers the execution of arbitrary code upon reconstruction.
In the case of CVE-2023-21529, an authenticated attacker can send a specifically crafted request to the server. Because the server trusts the serialized object, it processes the payload, leading to a compromise of the underlying system with the privileges of the Exchange service account.
Vulnerability Metrics
Section titled “Vulnerability Metrics”- CVSS v3.1 Score: 8.8 (High)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Classification: CWE-502 (Deserialization of Untrusted Data)
Affected Versions
Section titled “Affected Versions”The following versions are susceptible to this exploit:
- Exchange Server 2019 CU12: Versions < 15.02.1118.025
- Exchange Server 2019 CU11: Versions < 15.02.0986.041
- Exchange Server 2016 CU23: Versions < 15.01.2507.021
- Exchange Server 2013 CU23: Versions < 15.00.1497.047
Exploitation Flow
Section titled “Exploitation Flow”The attack chain typically follows a rapid progression from initial access to full environment encryption.
- Authentication: The attacker gains valid credentials for the Exchange environment (via phishing, credential stuffing, or previous leaks).
- Payload Delivery: A malicious serialized object is transmitted to the vulnerable Exchange endpoint.
- Trigger: The server deserializes the object, executing the embedded payload.
- Persistence: Storm-1175 typically establishes persistence by creating new administrative user accounts.
- Lateral Movement: Deployment of Remote Monitoring and Management (RMM) tools to navigate the network.
- Exfiltration & Impact: Sensitive data is exfiltrated, and Medusa ransomware is deployed across the infrastructure.
Forensic Investigation
Section titled “Forensic Investigation”From a forensic perspective, the “smoking gun” is often found in the behavior of the worker processes.
Traces & Logs
Section titled “Traces & Logs”- Process Tree Analysis: The most critical indicator is the spawning of anomalous child processes from
w3wp.exe(the IIS worker process). Any instance ofcmd.exe,powershell.exe, ornet.exeoriginating fromw3wp.exeis a high-confidence indicator of compromise. - Account Creation: Monitor Event ID 4720 (A user account was created) for unauthorized administrative accounts created shortly after unexpected
w3wp.exeactivity. - Web Shells: Check for newly created
.aspxfiles in the Exchange installation directories, which are often used to maintain access after the initial RCE.
IOCs (Indicators of Compromise)
Section titled “IOCs (Indicators of Compromise)”- Actor: Storm-1175
- Malware: Medusa Ransomware
- Behavioral IOCs: High-volume data transfer to unknown external IPs following the initial compromise.
Detection (Sigma & KQL)
Section titled “Detection (Sigma & KQL)”Proactive detection focuses on the behavioral anomalies described above.
Sigma Rule Logic
Section titled “Sigma Rule Logic”title: Exchange Server RCE - Suspicious Child Processlogsource: category: process_creationdetection: selection: ParentImage: '*w3wp.exe' Image: - '*cmd.exe' - '*powershell.exe' - '*net.exe' - '*whoami.exe' condition: selectionKQL (Hunting Query)
Section titled “KQL (Hunting Query)”DeviceProcessEvents| where InitiatingProcessFileName == "w3wp.exe"| where FileName in ("cmd.exe", "powershell.exe", "net.exe", "whoami.exe")| project TimeGenerated, DeviceName, FileName, ProcessCommandLine, InitiatingProcessParentFileNameMitigation
Section titled “Mitigation”Patching Apply the latest Cumulative Updates (CU) provided by Microsoft immediately. This is the only definitive fix.
Hardening Restrict the use of authenticated access to Exchange from untrusted locations. Implement MFA across all administrative accounts.
Monitoring Deploy EDR solutions configured to alert on anomalous child processes spawned by IIS worker processes.