Analysis Report Folder Analysis cache/emailkit_1.6.1 → cache/emailkit_1.6.2 - CVE-2025-14059

Shared security patch analysis results

AI Used: claude_cli haiku
Share this analysis
CVE Security Analysis & Writeups

Comprehensive security analysis generated by AI for each confirmed CVE match. Click on a CVE to view the detailed writeup including vulnerability background, technical details, patch analysis, and PoC guide.

CVE-2025-14059
AI-Generated Analysis
Use quotes for exact: \"SQL injection\" | Operators: hello AND bye, admin OR root, -error, NOT warning
Showing 0 to 0 of 0 results
EmailKit.php AI: No vulnerabilities
--- cache/emailkit_1.6.1/EmailKit.php	2026-01-08 00:33:05.834573228 +0000+++ cache/emailkit_1.6.2/EmailKit.php	2026-01-08 00:37:34.106910426 +0000@@ -6,7 +6,7 @@  * Description: EmailKit is the most-complete drag-and-drop Email template builder.
  * Author: wpmet
  * Author URI: https://wpmet.com
- * Version: 1.6.1
+ * Version: 1.6.2
  * Text Domain: emailkit
  * License:  GPLv3
  * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
@@ -68,7 +68,7 @@      */
     public function define_constants()
     {
-        define('EMAILKIT_VERSION', '1.6.1');
+        define('EMAILKIT_VERSION', '1.6.2');
         define('EMAILKIT_TEXTDOMAIN', 'emailkit');
         define('EMAILKIT_FILE', __FILE__);
         define('EMAILKIT_PATH', __DIR__);
AI Analysis
I'll analyze the provided code diff for security vulnerabilities.

Vulnerability Existed: no

No vulnerabilities identified - [File] EmailKit.php [Lines 9, 71]

Old Code:
```
* Version: 1.6.1
...
define('EMAILKIT_VERSION', '1.6.1');
```

Fixed Code:
```
* Version: 1.6.2
...
define('EMAILKIT_VERSION', '1.6.2');
```

Explanation:
This diff only contains version number updates from 1.6.1 to 1.6.2 in two locations (the file header comment and a PHP constant definition). These are purely cosmetic/metadata changes with no functional code modifications. Version bumps do not introduce or fix security vulnerabilities unless they reference actual code changes that address security issues. Since no functional code changes are present in this diff, there are no security fixes to analyze and no vulnerabilities are present in these changes.
CVE Analysis Results:
CVE-2025-14059: No
View CVE Description
The EmailKit plugin for WordPress is vulnerable to Arbitrary File Read via Path Traversal in all versions up to, and including, 1.6.1. This is due to missing path validation in the create_template REST API endpoint where user-controlled input from the emailkit-editor-template parameter is passed directly to file_get_contents() without sanitization. This makes it possible for 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, via the REST API. The file contents are stored in post meta and can be exfiltrated through MetForm's email confirmation feature.
includes/Admin/Api/CheckForm.php AI: No vulnerabilities CVE-2025-14059
--- cache/emailkit_1.6.1/includes/Admin/Api/CheckForm.php	2026-01-08 00:33:05.834573228 +0000+++ cache/emailkit_1.6.2/includes/Admin/Api/CheckForm.php	2026-01-08 00:37:34.126911640 +0000@@ -161,23 +161,34 @@         $html = '';
         if (!empty($request->get_param('emailkit-editor-template')) && trim($request->get_param('emailkit-editor-template')) !== '') {
             $template_path = $request->get_param('emailkit-editor-template');
-            $template = file_exists($template_path) ? file_get_contents($template_path) : '';
-            $html_path = str_replace("content.json", "content.html", $template_path);
-            $html = file_exists($html_path) ? file_get_contents($html_path) : '';
+            $allowed_base_path = wp_upload_dir()['basedir'] . '/emailkit/templates/';
+            $real_path = realpath($template_path);
+            if ($real_path === false || strpos($real_path, realpath($allowed_base_path)) !== 0) {
+                return new WP_REST_Response(['success' => false, 'message' => __('Invalid template path', 'emailkit')], 400);
+            }
+
+            $template = file_exists($real_path) ? file_get_contents($real_path) : '';
+            $html_path = str_replace("content.json", "content.html", $real_path);
+            
+            // Validate HTML path as well
+            $real_html_path = realpath($html_path);
+            if ($real_html_path !== false && strpos($real_html_path, realpath($allowed_base_path)) === 0) {
+                $html = file_exists($real_html_path) ? file_get_contents($real_html_path) : '';
+            }
         }
 
         // Create new emailkit post
         $post_id = wp_insert_post([
-            'post_title' => $template_title,
+            'post_title' => sanitize_text_field($template_title),
             'post_type' => 'emailkit',
             'post_status' => 'publish',
             'meta_input' => [
-                'emailkit_template_type' => $template_type,
-                'emailkit_form_id' => $form_id,
+                'emailkit_template_type' => sanitize_text_field($template_type),
+                'emailkit_form_id' => absint($form_id),
                 'emailkit_template_status' => 'active',
-                'emailkit_template_content_html' => $html,
+                'emailkit_template_content_html' => wp_kses_post($html),
                 'emailkit_template_content_object' => $template,
-                'emailkit_email_type' => $request->get_param('emailkit_email_type'),
+                'emailkit_email_type' => sanitize_text_field($request->get_param('emailkit_email_type')),
             ]
         ]);
 
AI Analysis
# Security Analysis: Code Diff for CheckForm.php

## Vulnerability 1: Path Traversal / Directory Traversal

**Vulnerability Existed:** yes

**CWE-22 - Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') - includes/Admin/Api/CheckForm.php Lines 163-165**

**Old Code:**
```php
$template_path = $request->get_param('emailkit-editor-template');
$template = file_exists($template_path) ? file_get_contents($template_path) : '';
$html_path = str_replace("content.json", "content.html", $template_path);
$html = file_exists($html_path) ? file_get_contents($html_path) : '';
```

**Fixed Code:**
```php
$template_path = $request->get_param('emailkit-editor-template');
$allowed_base_path = wp_upload_dir()['basedir'] . '/emailkit/templates/';
$real_path = realpath($template_path);
if ($real_path === false || strpos($real_path, realpath($allowed_base_path)) !== 0) {
    return new WP_REST_Response(['success' => false, 'message' => __('Invalid template path', 'emailkit')], 400);
}

$template = file_exists($real_path) ? file_get_contents($real_path) : '';
$html_path = str_replace("content.json", "content.html", $real_path);

// Validate HTML path as well
$real_html_path = realpath($html_path);
if ($real_html_path !== false && strpos($real_html_path, realpath($allowed_base_path)) === 0) {
    $html = file_exists($real_html_path) ? file_get_contents($real_html_path) : '';
}
```

**Explanation:**
The original code directly used user-supplied input (`$template_path` from `$request->get_param()`) to read files without validating that the path was within an allowed directory. An attacker could use path traversal sequences (e.g., `../../etc/passwd`) to read arbitrary files from the server. The fix implements proper path validation by:
1. Using `realpath()` to resolve the absolute path and detect traversal attempts
2. Comparing the resolved path against an allowed base directory (`wp_upload_dir()['basedir'] . '/emailkit/templates/'`)
3. Rejecting any paths outside the allowed directory
4. Applying the same validation to both the template and HTML file paths

---

## Vulnerability 2: Stored Cross-Site Scripting (XSS)

**Vulnerability Existed:** yes

**CWE-79 - Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') - includes/Admin/Api/CheckForm.php Lines 172-180**

**Old Code:**
```php
'meta_input' => [
    'emailkit_template_type' => $template_type,
    'emailkit_form_id' => $form_id,
    'emailkit_template_status' => 'active',
    'emailkit_template_content_html' => $html,
    'emailkit_template_content_object' => $template,
    'emailkit_email_type' => $request->get_param('emailkit_email_type'),
]
```

**Fixed Code:**
```php
'meta_input' => [
    'emailkit_template_type' => sanitize_text_field($template_type),
    'emailkit_form_id' => absint($form_id),
    'emailkit_template_status' => 'active',
    'emailkit_template_content_html' => wp_kses_post($html),
    'emailkit_template_content_object' => $template,
    'emailkit_email_type' => sanitize_text_field($request->get_param('emailkit_email_type')),
]
```

**Explanation:**
The original code stored unsanitized user input directly into post metadata without any sanitization. This allowed attackers to inject malicious scripts that would be stored in the database and executed when the data was later retrieved and displayed. Additionally, `$post_title` was not sanitized. The fix applies appropriate sanitization functions:
- `sanitize_text_field()` for text inputs (`template_type`, `template_title`, `emailkit_email_type`) - removes HTML/script tags
- `absint()` for numeric input (`form_id`) - ensures only integers
- `wp_kses_post()` for HTML content (`$html`) - allows safe HTML while removing dangerous elements

---

## Vulnerability 3: Improper Input Validation

**Vulnerability Existed:** yes

**CWE-20 - Improper Input Validation - includes/Admin/Api/CheckForm.php Lines 164, 184**

**Old Code:**
```php
$post_title = $template_title,  // No type checking or validation
'post_title' => $template_title,
'emailkit_form_id' => $form_id,  // No integer validation
```

**Fixed Code:**
```php
'post_title' => sanitize_text_field($template_title),
'emailkit_form_id' => absint($form_id),
```

**Explanation:**
The original code accepted and stored user input without validating expected data types or formats. The `$form_id` parameter should be numeric but was stored as-is, potentially allowing non-integer values. The `$template_title` should be text but had no validation. The fix validates input types: `absint()` coerces to integer (preventing SQL injection or type confusion), and `sanitize_text_field()` ensures text input is properly formatted and stripped of HTML.
CVE Analysis Results:
CVE-2025-14059: Yes
View CVE Description
The EmailKit plugin for WordPress is vulnerable to Arbitrary File Read via Path Traversal in all versions up to, and including, 1.6.1. This is due to missing path validation in the create_template REST API endpoint where user-controlled input from the emailkit-editor-template parameter is passed directly to file_get_contents() without sanitization. This makes it possible for 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, via the REST API. The file contents are stored in post meta and can be exfiltrated through MetForm's email confirmation feature.
includes/Admin/EmailKitEditor/EmailKitEditorInit.php AI: 1 vulnerabilities 1 false positive
--- cache/emailkit_1.6.1/includes/Admin/EmailKitEditor/EmailKitEditorInit.php	2026-01-08 00:33:05.838573476 +0000+++ cache/emailkit_1.6.2/includes/Admin/EmailKitEditor/EmailKitEditorInit.php	2026-01-08 00:37:34.174914553 +0000@@ -43,7 +43,7 @@     public function add_editor_template()
     {
 
-        if(is_plugin_active('uafrica-shipping/uafrica-shipping.php')){
+        if(is_plugin_active('uafrica-shipping/uafrica-shipping.php') || ( get_template() == 'entry' )){
          // Check if WooCommerce is active and initialize session if needed
             if (class_exists('WooCommerce') && function_exists('WC')) {
                 if (is_null(WC()->session) && !headers_sent()) {
AI Analysis
I'll analyze this code diff for security vulnerabilities.

Vulnerability Existed: yes
FALSE POSITIVE

**Insecure Comparison / Type Juggling Vulnerability - CWE-1025** - includes/Admin/EmailKitEditor/EmailKitEditorInit.php - Line 46

**Old Code:**
```php
if(is_plugin_active('uafrica-shipping/uafrica-shipping.php')){
```

**Fixed Code:**
```php
if(is_plugin_active('uafrica-shipping/uafrica-shipping.php') || ( get_template() == 'entry' )){
```

**Explanation:**
The added condition `get_template() == 'entry'` uses a loose comparison operator (`==`) instead of a strict comparison operator (`===`). This creates a type juggling vulnerability where `get_template()` could return a value that is loosely equal to the string `'entry'` without being exactly that string. For example, if `get_template()` returns an integer `0` or an empty string, the loose comparison would still evaluate to true in certain PHP versions or contexts, potentially allowing unintended code execution. The fix should use `get_template() === 'entry'` for strict type comparison to prevent type juggling attacks.
CVE Analysis Results:
CVE-2025-14059: No
View CVE Description
The EmailKit plugin for WordPress is vulnerable to Arbitrary File Read via Path Traversal in all versions up to, and including, 1.6.1. This is due to missing path validation in the create_template REST API endpoint where user-controlled input from the emailkit-editor-template parameter is passed directly to file_get_contents() without sanitization. This makes it possible for 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, via the REST API. The file contents are stored in post meta and can be exfiltrated through MetForm's email confirmation feature.
includes/Admin/EmailSettings/MetformEmailSettings.php AI: No vulnerabilities
--- cache/emailkit_1.6.1/includes/Admin/EmailSettings/MetformEmailSettings.php	2026-01-08 00:33:05.838573476 +0000+++ cache/emailkit_1.6.2/includes/Admin/EmailSettings/MetformEmailSettings.php	2026-01-08 00:37:34.202916252 +0000@@ -94,7 +94,7 @@                 <span class="emailkit-upgrade-text">
                     Get <strong>EmailKit Pro</strong> - the drag-and-drop builder to <br> customize your confirmation emails.
                 </span>
-                <a class="upgrade-button" target="_blank" href="https://wpmet.com/plugin/metform/pricing/">
+                <a class="upgrade-button" target="_blank" href="https://wpmet.com/plugin/emailkit/pricing/">
                     <span><svg xmlns="http://www.w3.org/2000/svg" width="13" height="14" viewBox="0 0 13 14" fill="none">
                             <path d="M10.6 6.3999H2.2C1.53726 6.3999 1 6.93716 1 7.5999V11.7999C1 12.4626 1.53726 12.9999 2.2 12.9999H10.6C11.2627 12.9999 11.8 12.4626 11.8 11.7999V7.5999C11.8 6.93716 11.2627 6.3999 10.6 6.3999Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
                             <path d="M3.40015 6.4V4C3.40015 3.20435 3.71622 2.44129 4.27883 1.87868C4.84144 1.31607 5.6045 1 6.40015 1C7.1958 1 7.95886 1.31607 8.52147 1.87868C9.08408 2.44129 9.40015 3.20435 9.40015 4V6.4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
AI Analysis
I'll analyze this code diff for security vulnerabilities.

Vulnerability Existed: no
No CWE - N/A - includes/Admin/EmailSettings/MetformEmailSettings.php (Line 97)

Old Code:
```
<a class="upgrade-button" target="_blank" href="https://wpmet.com/plugin/metform/pricing/">
```

Fixed Code:
```
<a class="upgrade-button" target="_blank" href="https://wpmet.com/plugin/emailkit/pricing/">
```

Explanation:
This change updates a hyperlink URL from `https://wpmet.com/plugin/metform/pricing/` to `https://wpmet.com/plugin/emailkit/pricing/`. This is a simple URL correction that fixes an incorrect product reference in a marketing link. No security vulnerability exists in either version. The link is hardcoded, uses HTTPS protocol, and does not involve any user input, data processing, or sensitive operations that could introduce security risks. This is a legitimate bug fix to ensure the link directs users to the correct product page.
CVE Analysis Results:
CVE-2025-14059: No
View CVE Description
The EmailKit plugin for WordPress is vulnerable to Arbitrary File Read via Path Traversal in all versions up to, and including, 1.6.1. This is due to missing path validation in the create_template REST API endpoint where user-controlled input from the emailkit-editor-template parameter is passed directly to file_get_contents() without sanitization. This makes it possible for 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, via the REST API. The file contents are stored in post meta and can be exfiltrated through MetForm's email confirmation feature.
includes/Admin/MetaField/StyleLoad.php AI: 1 vulnerabilities 1 false positive
--- cache/emailkit_1.6.1/includes/Admin/MetaField/StyleLoad.php	2026-01-08 00:33:05.842573724 +0000+++ cache/emailkit_1.6.2/includes/Admin/MetaField/StyleLoad.php	2026-01-08 00:37:34.238918438 +0000@@ -102,6 +102,14 @@ 		add_action('wp_footer', 'wp_print_footer_scripts', 20);
 		add_action('wp_footer', 'wp_auth_check_html', 30); */
 
+		// Entry theme style conflict with emailkit
+		if ( isset($_GET['action']) && $_GET['action'] == 'emailkit-builder' && get_template() == 'entry' ) {
+			add_action( 'wp_print_styles', function() {
+				wp_dequeue_style('bootstrap');
+				wp_dequeue_style('swg-css');
+			}, 100);
+		}
+
 		// Hello Elementor theme style conflict with emailkit
 			if ( get_template() == 'hello-elementor' ) {
 				wp_dequeue_style('hello-elementor');
AI Analysis
I'll analyze this code diff for security vulnerabilities.

```
Vulnerability Existed: yes
FALSE POSITIVE
Improper Input Validation - CWE-20 - includes/Admin/MetaField/StyleLoad.php - Lines 105-106

Old Code:
[No previous code - this is a new addition]

Fixed Code:
if ( isset($_GET['action']) && $_GET['action'] == 'emailkit-builder' && get_template() == 'entry' ) {

Explanation:
This code contains a security vulnerability. The condition checks `$_GET['action']` directly without proper sanitization or validation. While the code uses a simple string comparison (`== 'emailkit-builder'`), which provides some protection against exploitation, directly accessing unsanitized `$_GET` superglobals is poor practice and violates WordPress security standards.

The vulnerability is:
- **CWE-20 (Improper Input Validation)**: The `$_GET['action']` value is not sanitized, escaped, or validated before use
- **WordPress Best Practice Violation**: WordPress recommends using sanitization functions like `sanitize_text_field()` or `wp_verify_nonce()` for GET parameters
- **Potential Issue**: While the string comparison reduces immediate risk, best practice requires: `isset($_GET['action']) && sanitize_text_field($_GET['action']) == 'emailkit-builder'`

The fix would be to sanitize the GET parameter:
```php
if ( isset($_GET['action']) && sanitize_text_field($_GET['action']) == 'emailkit-builder' && get_template() == 'entry' ) {
```

Additionally, using a nonce to verify the request origin would provide defense-in-depth protection.
```
CVE Analysis Results:
CVE-2025-14059: No
View CVE Description
The EmailKit plugin for WordPress is vulnerable to Arbitrary File Read via Path Traversal in all versions up to, and including, 1.6.1. This is due to missing path validation in the create_template REST API endpoint where user-controlled input from the emailkit-editor-template parameter is passed directly to file_get_contents() without sanitization. This makes it possible for 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, via the REST API. The file contents are stored in post meta and can be exfiltrated through MetForm's email confirmation feature.