CVE-2025-52691

SmarterMail Unrestricted File Upload Exploitation (CVE-2025-52691)

Detects exploitation of CVE-2025-52691, an unrestricted file upload vulnerability in SmarterTools SmarterMail. This vulnerability allows attackers to upload files with dangerous types (e.g., web shells, executables) to the mail server, potentially enabling remote code execution. This CVE is listed in CISA's Known Exploited Vulnerabilities catalog.

Vulnerability Intelligence

KEV — Known Exploited

CVSS

10.0
Critical (9.0–10)

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Write-up coming soon

What is CVE-2025-52691 SmarterMail Unrestricted File Upload Exploitation (CVE-2025-52691)?

SmarterMail Unrestricted File Upload Exploitation (CVE-2025-52691) (CVE-2025-52691) maps to the Initial Access and Execution and Persistence tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for SmarterMail Unrestricted File Upload Exploitation (CVE-2025-52691), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Microsoft Sentinel DeviceFileEvents, Microsoft Sentinel DeviceProcessEvents. The queries below are rated critical severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution Persistence
Microsoft Sentinel / Defender
kusto
union DeviceFileEvents, DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where DeviceName has_any ("mail", "smartermail", "smtp")
| where (
    (ActionType == "FileCreated" and FileName matches regex @"\.(aspx|asp|php|jsp|cfm|cgi|pl|py|rb|sh|exe|dll|bat|cmd|ps1|vbs|hta)$"
      and FolderPath matches regex @"(?i)(smartermail|smarter\\mail|mailroot|webmail)")
    or
    (ActionType in ("ProcessCreated") and InitiatingProcessName =~ "SmarterMail.exe"
      and FileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "certutil.exe", "rundll32.exe", "regsvr32.exe"))
  )
| extend RiskIndicator = case(
    ActionType == "FileCreated" and FileName matches regex @"\.(aspx|asp|php|jsp)$", "WebShellDrop",
    ActionType == "ProcessCreated" and InitiatingProcessName =~ "SmarterMail.exe", "SuspiciousChildProcess",
    "UnknownUpload"
  )
| project TimeGenerated, DeviceName, ActionType, FileName, FolderPath, InitiatingProcessName, InitiatingProcessCommandLine, RiskIndicator, AccountName

Detects suspicious file creation with dangerous extensions under SmarterMail directories, or suspicious child processes spawned by the SmarterMail process, indicating potential web shell upload or post-exploitation activity via CVE-2025-52691.

critical severity high confidence

Data Sources

Microsoft Defender for Endpoint Microsoft Sentinel DeviceFileEvents Microsoft Sentinel DeviceProcessEvents

Required Tables

DeviceFileEvents DeviceProcessEvents

False Positives

  • Legitimate administrative scripts deployed by IT staff to the SmarterMail directory
  • Antivirus or backup software creating temporary files with unusual extensions in mail directories
  • SmarterMail update processes creating new executables or DLLs during patching

Sigma rule & cross-platform mapping

The detection logic for SmarterMail Unrestricted File Upload Exploitation (CVE-2025-52691) (CVE-2025-52691) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulate Web Shell Upload to SmarterMail Directory

    Expected signal: Sysmon Event ID 11 (FileCreate) with TargetFilename containing 'SmarterMail' and ending in '.aspx'; DeviceFileEvents in Defender with ActionType=FileCreated

  2. Test 2Simulate SmarterMail Spawning Suspicious Child Process

    Expected signal: Sysmon Event ID 1 (ProcessCreate) showing cmd.exe with parent process context; DeviceProcessEvents showing cmd.exe creation with CommandLine containing 'whoami'

  3. Test 3Upload Executable File to Simulated Mail Server Web Directory

    Expected signal: Sysmon Event ID 11 (FileCreate) with TargetFilename matching 'C:\Temp\mailroot\webmail\update.exe'; file hash telemetry for the copied executable

  4. Test 4Simulate PowerShell Execution via Web Shell Context

    Expected signal: Sysmon Event ID 1 (ProcessCreate) for powershell.exe with CommandLine containing reconnaissance commands; PowerShell Script Block Logging (Event ID 4104) if enabled


Response Playbook

Triage

  1. Identify the SmarterMail server(s) affected by reviewing file creation alerts for dangerous extensions (ASPX, PHP, JSP, etc.) under the SmarterMail web root and mail directories.
  2. Determine the source IP address of the HTTP/S request that triggered the file upload by correlating IIS or SmarterMail access logs with the timestamp of the suspicious file creation event.
  3. Check whether the uploaded file has been accessed or executed subsequent to creation by reviewing web server access logs for requests to the file path and process creation events with the uploaded file as initiator.
  4. Assess the scope of compromise by searching for lateral movement indicators, additional web shells, or persistence mechanisms (scheduled tasks, registry run keys, new service installs) on the affected host.

Containment

  1. Immediately isolate the SmarterMail server from the network or restrict inbound web access (ports 80/443/8080/9998) via firewall rule to prevent further exploitation or attacker interaction with any uploaded web shell.
  2. Delete or quarantine any identified uploaded files with dangerous extensions from the SmarterMail web directory, and reset credentials for all accounts with access to the SmarterMail administration interface.

Evidence Collection

  1. Collect IIS or SmarterMail web server access logs covering the period around the file creation event, preserving the full HTTP request headers, body size, and source IP for forensic analysis.
  2. Capture a memory image and disk forensic image of the affected SmarterMail server before remediation to preserve volatile evidence of attacker activity and any in-memory web shell or implant.

Escalation Criteria

  • ! Escalate immediately to incident response if the uploaded file has been accessed or executed, indicating active post-exploitation, or if evidence of lateral movement from the mail server to other internal systems is detected.
  • ! Escalate to senior security leadership and legal/compliance if email data exfiltration is suspected, given that SmarterMail hosts sensitive communications and PII that may trigger breach notification obligations.

Investigation Guide

Forensic Artifacts

  • > SmarterMail web server access logs (IIS logs at %SystemDrive%\inetpub\logs\LogFiles or SmarterMail-specific logs at %ProgramData%\SmarterTools\SmarterMail\Logs) containing HTTP POST requests to upload endpoints
  • > File system artifacts: newly created files with dangerous extensions (ASPX, PHP, JSP, etc.) in the SmarterMail installation directory (typically C:\Program Files (x86)\SmarterTools\SmarterMail\MRS\)
  • > Windows Security Event Log (Event ID 4688) and Sysmon logs (Event ID 1, 11) showing child process creation from SmarterMail.exe and file creation events in mail server directories
  • > Network flow records showing inbound HTTP/S connections to the SmarterMail server's web interface ports (80, 443, 9998) from external IP addresses at the time of exploitation

Tuning Guidance

Tune the detection by first establishing a baseline of legitimate file types created in SmarterMail directories during normal operations (updates, plugin installs). Whitelist known-good SmarterMail update processes by their hash or signed certificate. For the child process detection, create exclusions for specific monitoring tools (antivirus, backup agents) known to be invoked from service accounts associated with SmarterMail. Adjust the file extension list based on the specific SmarterMail version's web technology stack — older versions using Classic ASP may generate more ASP extension noise during legitimate operations.


Hunting Queries

Hunt for low-frequency file creation events with dangerous extensions in SmarterMail directories over the past 30 days to identify historically uploaded web shells or malicious files that may have evaded real-time detection.

Hunting — KQL
kql
DeviceFileEvents
| where TimeGenerated > ago(30d)
| where InitiatingProcessName =~ "SmarterMail.exe" or FolderPath contains "SmarterMail"
| where FileName matches regex @"(?i)\.(aspx|asp|php|jsp|cfm|cgi|pl|exe|dll|bat|cmd|ps1|vbs|hta)$"
| summarize FileCount=count(), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated) by DeviceName, FileName, FolderPath, InitiatingProcessName
| where FileCount < 5
| order by LastSeen desc
Hunting — SPL
spl
index=sysmon EventCode=11
| eval lower_path=lower(TargetFilename)
| where (lower_path LIKE "%smartermail%" OR lower_path LIKE "%mailroot%")
  AND match(lower_path, "\.(aspx|asp|php|jsp|exe|dll|bat|cmd|ps1|vbs|hta)$")
| bin _time span=1d
| stats count AS DailyCount values(TargetFilename) AS Files by _time, host
| where DailyCount < 10
| sort -_time

Atomic Red Team Tests

Test 1 Simulate Web Shell Upload to SmarterMail Directory
windows

Simulates an attacker uploading a web shell file with an ASPX extension to a directory mimicking the SmarterMail web root, triggering file creation telemetry without executing malicious code.

Command

powershell
New-Item -Path 'C:\Temp\SmarterMail\MRS\shell_test.aspx' -ItemType File -Force -Value '<%@ Page Language="C#" %><% Response.Write("test"); %>'

Cleanup

powershell
Remove-Item -Path 'C:\Temp\SmarterMail\MRS\shell_test.aspx' -Force -ErrorAction SilentlyContinue; Remove-Item -Path 'C:\Temp\SmarterMail' -Recurse -Force -ErrorAction SilentlyContinue

Expected Telemetry

Sysmon Event ID 11 (FileCreate) with TargetFilename containing 'SmarterMail' and ending in '.aspx'; DeviceFileEvents in Defender with ActionType=FileCreated

Expected Detection

Rule should trigger on file creation of .aspx extension within a path matching 'smartermail' pattern

Test 2 Simulate SmarterMail Spawning Suspicious Child Process
windows

Simulates post-exploitation activity where a web shell executed under SmarterMail context spawns cmd.exe, mimicking command execution after successful file upload exploitation.

Command

powershell
Start-Process -FilePath 'cmd.exe' -ArgumentList '/c whoami > C:\Temp\smartermail_test_output.txt' -Wait

Cleanup

powershell
Remove-Item -Path 'C:\Temp\smartermail_test_output.txt' -Force -ErrorAction SilentlyContinue

Expected Telemetry

Sysmon Event ID 1 (ProcessCreate) showing cmd.exe with parent process context; DeviceProcessEvents showing cmd.exe creation with CommandLine containing 'whoami'

Expected Detection

Process creation rule should flag cmd.exe spawning — in production this would be correlated with SmarterMail.exe as parent; adjust test to use a renamed SmarterMail stub if full simulation is needed

Test 3 Upload Executable File to Simulated Mail Server Web Directory
windows

Tests detection of executable file creation in a SmarterMail-like directory path, simulating an attacker uploading a binary payload alongside or instead of a web shell.

Command

powershell
New-Item -Path 'C:\Temp\mailroot\webmail\' -ItemType Directory -Force; Copy-Item -Path 'C:\Windows\System32\calc.exe' -Destination 'C:\Temp\mailroot\webmail\update.exe' -Force

Cleanup

powershell
Remove-Item -Path 'C:\Temp\mailroot' -Recurse -Force -ErrorAction SilentlyContinue

Expected Telemetry

Sysmon Event ID 11 (FileCreate) with TargetFilename matching 'C:\Temp\mailroot\webmail\update.exe'; file hash telemetry for the copied executable

Expected Detection

Rule should trigger on .exe creation within a path matching 'mailroot' or 'webmail' pattern, flagging the file as a potentially dangerous upload

Test 4 Simulate PowerShell Execution via Web Shell Context
windows

Simulates an attacker using an uploaded web shell to execute PowerShell for reconnaissance, a common post-exploitation step following successful CVE-2025-52691 exploitation.

Command

powershell
powershell.exe -NoProfile -NonInteractive -Command "Get-LocalUser | Select-Object Name,Enabled | ConvertTo-Json" > C:\Temp\recon_output.txt

Cleanup

powershell
Remove-Item -Path 'C:\Temp\recon_output.txt' -Force -ErrorAction SilentlyContinue

Expected Telemetry

Sysmon Event ID 1 (ProcessCreate) for powershell.exe with CommandLine containing reconnaissance commands; PowerShell Script Block Logging (Event ID 4104) if enabled

Expected Detection

Child process detection rule triggers on powershell.exe execution; in production correlated with SmarterMail.exe parent process indicating web shell execution chain

Related Detections