Plugin Directory

Changeset 3281379


Ignore:
Timestamp:
04/25/2025 02:11:54 AM (10 months ago)
Author:
marcusbs
Message:

Resolved SQL injection vulnerability

Location:
wp-mailing-group
Files:
95 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-mailing-group/trunk/mailing-group-module.php

    r3275177 r3281379  
    11<?php /**
    22* @package Mailing_group_module
    3 * @version 3.0.4
     3* @version 3.0.5
    44*/
    55/*
     
    99Author: Yamna Khawaja
    1010Author URI: https://www.wpmailinggroup.com/
    11 Version: 3.0.4
     11Version: 3.0.5
    1212License: GPL v2 or later
    1313License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3939
    4040$WPMG_SETTINGS = get_option("WPMG_SETTINGS");
    41 $MG_VERSION_NO = '3.0.4';
     41$MG_VERSION_NO = '3.0.5';
    4242$WPMG_SETTINGS['MG_VERSION_NO']  = $MG_VERSION_NO;
    4343$WPMG_SETTINGS['MG_PLUGIN_TYPE'] = 'FREE';
     
    144144    $MG_SUPPORT_EMAIL    = (isset($wpmgs['MG_SUPPORT_EMAIL']) && $wpmgs['MG_SUPPORT_EMAIL']!=''?esc_html($wpmgs['MG_SUPPORT_EMAIL']):'[email protected]');
    145145    $MG_SUPPORT_PHONE    = (isset($wpmgs['MG_SUPPORT_PHONE']) && $wpmgs['MG_SUPPORT_PHONE']!=''?esc_html($wpmgs['MG_SUPPORT_PHONE']):'1800-123-1234');
    146     $MG_VERSION_NO       = (isset($wpmgs['MG_VERSION_NO'])    && $wpmgs['MG_VERSION_NO']!=''?esc_html($wpmgs['MG_VERSION_NO']):'3.0.4');
     146    $MG_VERSION_NO       = (isset($wpmgs['MG_VERSION_NO'])    && $wpmgs['MG_VERSION_NO']!=''?esc_html($wpmgs['MG_VERSION_NO']):'3.0.5');
    147147   
    148148    $wpmg_setting = array(
  • wp-mailing-group/trunk/readme.txt

    r3275177 r3281379  
    66Tested up to: 6.8
    77Tested up to PHP: 8.2
    8 Stable tag: 3.0.4
     8Stable tag: 3.0.5
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    132132== Changelog ==
    133133
     134=3.0.5 =
     135*Resolved sql injection vulnerability.
     136
    134137=3.0.4 =
    135138*Tested with latest wp version.
  • wp-mailing-group/trunk/template/mg_mailinggrouplist.php

    r3268122 r3281379  
    1010
    1111if ($info == "del") {
    12 
    13     $wpdb->query("delete from " . $table_name_group . " where id=" . $delid);
    14 
    15     $wpdb->query("delete from " . $table_name_requestmanager_taxonomy . " where group_id=" . $delid);
    16 
    17     wpmg_showmessages("updated", __("Mailing group has been deleted successfully.", 'wp-mailing-group'));
     12    // Check if user is logged in
     13    if (!is_user_logged_in()) {
     14        wp_die(__('You must be logged in to perform this action.', 'wp-mailing-group'));
     15    }
     16
     17    // Ensure user has proper capabilities
     18    if (!current_user_can('manage_options')) {
     19        wp_die(__('You do not have sufficient permissions to access this page.', 'wp-mailing-group'));
     20    }
     21
     22    // Verify nonce
     23    if (!isset($_GET['_wpnonce']) || !wp_verify_nonce($_GET['_wpnonce'], 'delete_mailing_group')) {
     24        wp_die(__('Security check failed', 'wp-mailing-group'));
     25    }
     26
     27    // Ensure $delid is a positive integer
     28    $delid = absint($delid);
     29    if ($delid > 0) {
     30        // Use prepared statements
     31        $wpdb->query($wpdb->prepare("DELETE FROM $table_name_group WHERE id = %d", $delid));
     32        $wpdb->query($wpdb->prepare("DELETE FROM $table_name_requestmanager_taxonomy WHERE group_id = %d", $delid));
     33        wpmg_showmessages("updated", __("Mailing group has been deleted successfully.", 'wp-mailing-group'));
     34    }
    1835}
    1936
     
    184201                            |<a class="import_users" title="<?php esc_attr_e("Import Users", 'wp-mailing-group'); ?>" href="admin.php?page=wpmg_mailinggroup_importuser&gid=<?php echo esc_attr($id); ?>"></a>
    185202
    186                             |<a class="quick_edit edit_record" title="<?php esc_attr_e("Edit", 'wp-mailing-group'); ?>" name="<?php echo esc_attr($id); ?>" href="#"></a>|<a class="delete_record" title="<?php esc_attr_e("Delete", 'wp-mailing-group'); ?>" href="admin.php?page=wpmg_mailinggroup_list&info=del&did=<?php echo esc_attr($id); ?>" onclick="return confirm('<?php echo esc_js(__("Are you sure you want to delete this group?", 'wp-mailing-group')); ?>');"></a>
     203                            |<a class="quick_edit edit_record" title="<?php esc_attr_e("Edit", 'wp-mailing-group'); ?>" name="<?php echo esc_attr($id); ?>" href="#"></a>|<a class="delete_record" title="<?php esc_attr_e("Delete", 'wp-mailing-group'); ?>" href="<?php echo wp_nonce_url('admin.php?page=wpmg_mailinggroup_list&info=del&did=' . esc_attr($id), 'delete_mailing_group'); ?>" onclick="return confirm('<?php echo esc_js(__("Are you sure you want to delete this group?", 'wp-mailing-group')); ?>');"></a>
    187204                        </td>
    188205
Note: See TracChangeset for help on using the changeset viewer.