CVE-2025-14059
Executive Summary
CVE-2025-14059 is a critical Path Traversal vulnerability (CWE-22) in the EmailKit WordPress plugin, affecting all versions up to and including 1.6.1. The flaw resides in the create_template REST API endpoint, where the emailkit-editor-template parameter is passed directly to file_get_contents() without proper sanitization or path validation. This allows authenticated attackers with Author-level permissions or higher to read arbitrary files on the server, including sensitive configuration files like /etc/passwd and wp-config.php. The file contents are stored in post meta and can be exfiltrated through MetForm's email confirmation feature, making this a high-impact data disclosure vulnerability.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the WordPress plugin ecosystem specifically. The EmailKit plugin is distributed via the official WordPress plugin repository and third-party marketplaces. Since the patch status is UNKNOWN / UNPATCHED, users are advised to immediately disable the plugin until a security update is released. The lack of OSV or GitHub advisory data indicates limited public disclosure, but the exploit mechanics are well-understood.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely via HTTP requests.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Requires Author-level authentication.
- User Interaction (UI): None (N) – No user action needed.
- Scope (S): Unchanged (U) – Vulnerability does not affect other components.
- Confidentiality (C): High (H) – Arbitrary file read exposes sensitive data.
- Integrity (I): None (N) – No file modification.
- Availability (A): None (N) – No denial of service.
CVSS Score: 6.5 (Medium) – While the confidentiality impact is high, the requirement for authentication lowers the overall severity. However, in a WordPress context, Author-level accounts are common, making this a realistic threat.
Deep Dive & Mechanics
The vulnerability is triggered via the WordPress REST API endpoint /wp-json/emailkit/v1/create_template. The emailkit-editor-template parameter is expected to contain a file path, but no validation is performed to ensure the path is within the plugin's allowed directory. The code directly passes this user-controlled input to file_get_contents(), which reads the file from the server's filesystem.
Attack Flow:
- Attacker authenticates with an Author-level account.
- Sends a POST request to
/wp-json/emailkit/v1/create_templatewithemailkit-editor-templateset to a path like../../../../etc/passwd. - The plugin reads the file and stores its contents in WordPress post meta.
- The attacker then uses MetForm's email confirmation feature to exfiltrate the stored data, or directly queries the post meta via another API endpoint.
Why This Works:
- No path canonicalization or directory traversal checks.
file_get_contents()is used without a base directory restriction.- The result is stored in post meta, which is accessible to authenticated users.
Vulnerable vs. Patched Code
Vulnerable Code (EmailKit <= 1.6.1):
// In create_template endpoint handler
$template_path = $_POST['emailkit-editor-template'];
$template_content = file_get_contents($template_path);
update_post_meta($post_id, '_emailkit_template_content', $template_content);
Patched Code (Hypothetical):
// In create_template endpoint handler
$allowed_dir = WP_CONTENT_DIR . '/uploads/emailkit-templates/';
$template_path = realpath($allowed_dir . basename($_POST['emailkit-editor-template']));
if (strpos($template_path, $allowed_dir) !== 0) {
wp_die('Invalid path', 400);
}
$template_content = file_get_contents($template_path);
update_post_meta($post_id, '_emailkit_template_content', $template_content);
The patched version uses realpath() to resolve the path and then checks that it starts with the allowed directory, preventing traversal.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with EmailKit plugin <= 1.6.1.
- Author-level account credentials (e.g.,
author:password).
Exploit Steps:
- Authenticate and obtain a nonce or cookie.
- Send a crafted POST request to the REST API endpoint.
Example cURL Command:
curl -X POST 'https://target.com/wp-json/emailkit/v1/create_template' \
-H 'Cookie: wordpress_logged_in_<hash>=<cookie>' \
-d 'emailkit-editor-template=../../../../etc/passwd&title=test'
Exfiltration via MetForm:
- Create a MetForm form with email confirmation enabled.
- The stored post meta is automatically included in the email, sending the file contents to the attacker's email.
Blue Team (Detection & Hardening)
Detection:
- Monitor REST API logs for unusual
emailkit-editor-templatevalues containing../or absolute paths. - Alert on POST requests to
/wp-json/emailkit/v1/create_templatefrom Author-level users.
Hardening:
- Disable the EmailKit plugin immediately.
- Restrict Author-level users from accessing the REST API endpoint via
.htaccessor a custom plugin. - Implement a Web Application Firewall (WAF) rule to block path traversal patterns.
Indicators of Compromise (IOCs)
- File Paths:
/etc/passwd,/etc/shadow,wp-config.php,.env,config.php - API Endpoint:
/wp-json/emailkit/v1/create_template - POST Parameter:
emailkit-editor-templatewith values containing../or/at the start. - Post Meta Key:
_emailkit_template_contentcontaining sensitive file data. - MetForm Email: Emails sent from the site containing unexpected file contents.
Detection Engineering
YARA Rule
rule CVE_2025_14059_EmailKit_PathTraversal {
meta:
description = "Detects path traversal attempts in EmailKit plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-14059"
strings:
$traversal = /\.\.\/|\.\.\\|%2e%2e%2f|%2e%2e%5c/
$endpoint = "emailkit-editor-template"
condition:
$endpoint and $traversal
}
Sigma Rule
title: CVE-2025-14059 EmailKit Path Traversal
id: cve-2025-14059
status: experimental
description: Detects path traversal attempts in EmailKit plugin REST API
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/wp-json/emailkit/v1/create_template'
cs-uri-query|contains: 'emailkit-editor-template'
keywords:
- '\.\./'
- '\.\.\\'
- '%2e%2e%2f'
- '%2e%2e%5c'
condition: selection and keywords
falsepositives:
- Legitimate use of template paths (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-14059 EmailKit Path Traversal Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-json/emailkit/v1/create_template"; http_uri;
content:"emailkit-editor-template"; http_client_body;
pcre:"/(\.\.\/|\.\.\\|%2e%2e%2f|%2e%2e%5c)/i";
sid:10000001;
rev:1;
reference:cve,2025-14059;
)
Remediation & Mitigation
Immediate Actions:
- Disable the EmailKit plugin until a patched version is released.
- Review server logs for any unauthorized file reads.
- Rotate all secrets stored in
wp-config.php(database passwords, salts, keys). - Audit Author-level accounts and remove any that are not necessary.
Long-Term Fixes:
- Apply the patched code (see Vulnerable vs. Patched Code section) if you have developer access.
- Implement a WAF rule to block path traversal patterns.
- Use a security plugin like Wordfence to monitor REST API abuse.
Workaround:
- Restrict access to the REST API endpoint by adding the following to
.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-json/emailkit/v1/create_template [NC]
RewriteCond %{REQUEST_METHOD} POST [NC]
RewriteRule .* - [F,L]
</IfModule>
Valters IT
Securing WordPress Ecosystems
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.