Plugin Directory

Changeset 3434387


Ignore:
Timestamp:
01/07/2026 01:33:27 PM (2 months ago)
Author:
xfinitysoft
Message:

Security: Fixed missing authorization vulnerability in AJAX handlers (CVE-2025-14070).
Security: Added capability checks to send_test_email and xs_send_mail functions.
Security: Restricted custom post type access to administrators only (prevent nonce extraction).
Security: Changed custom post type from public to private with manage_options capability.
Security: Improved nonce verification and access control for admin-only functions.

Location:
review-for-discount
Files:
39 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • review-for-discount/trunk/admin/class-xswcrd-review-discounts-admin.php

    r3405128 r3434387  
    162162                    'not_found_in_trash' => esc_html__( 'No Review Discount found in trash', 'review-for-discount' ),
    163163                ),
    164                 'public'              => true,
     164                'public'              => false,
    165165                'supports'            => array( 'title' ),
    166166                'show_ui'             => true,
    167                 'capability_type'     => 'post',
     167                'capability_type'     => array( 'review_discount', 'review_discounts' ),
     168                'map_meta_cap'        => true,
    168169                'show_in_menu'        => true,
    169170                'menu_icon'           => 'dashicons-awards',
    170                 'map_meta_cap'        => true,
    171                 'publicly_queryable'  => true,
    172                 'exclude_from_search' => false,
     171                'publicly_queryable'  => false,
     172                'exclude_from_search' => true,
    173173                'hierarchical'        => false,
    174                 'rewrite'             => array(
    175                     'slug'       => 'xswc-review-discount',
    176                     'with_front' => true,
    177                 ),
     174                'rewrite'             => false,
    178175                'query_var'           => false,
    179                 'has_archive'         => 'false',
     176                'has_archive'         => false,
    180177
    181178            )
     
    424421     */
    425422    public function xswcrd_send_test_email() {
     423        // Verify nonce for CSRF protection.
    426424        if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ?? '' ) ), 'xswcrd_test_email' ) ) {
    427425            wp_die( 'Security check failed.' );
     426        }
     427
     428        // Verify user has admin capabilities - fixes CVE-2025-14070.
     429        if ( ! current_user_can( 'manage_options' ) ) {
     430            wp_die( 'Insufficient permissions.' );
    428431        }
    429432        global $current_user;
     
    600603     */
    601604    public function xs_send_mail() {
     605        // Verify user has admin capabilities.
     606        if ( ! current_user_can( 'manage_options' ) ) {
     607            wp_send_json( array( 'status' => false ) );
     608            wp_die();
     609        }
     610
    602611        $data = array();
    603612        if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'xswcrd_test_email' ) && isset( $_POST['data'] ) && ! empty( $_POST['data'] ) ) {
  • review-for-discount/trunk/includes/class-xswcrd-review-discounts-activator.php

    r3404686 r3434387  
    3030     */
    3131    public static function xswcrd_activate() {
     32        $roles = array( 'administrator', 'shop_manager' );
     33
     34        $caps = array(
     35            'edit_review_discount',
     36            'read_review_discount',
     37            'delete_review_discount',
     38            'edit_review_discounts',
     39            'edit_others_review_discounts',
     40            'publish_review_discounts',
     41            'read_private_review_discounts',
     42            'delete_review_discounts',
     43        );
     44
     45        foreach ( $roles as $role_name ) {
     46            $role = get_role( $role_name );
     47            if ( ! $role ) {
     48                continue;
     49            }
     50
     51            foreach ( $caps as $cap ) {
     52                $role->add_cap( $cap );
     53            }
     54        }
    3255        $default_settings = array(
    3356            'enable'               => 'on',
  • review-for-discount/trunk/includes/class-xswcrd-review-discounts.php

    r3404686 r3434387  
    6767     */
    6868    public function __construct() {
    69         if ( defined( 'WC_REVIEW_DISCOUNTS_VERSION' ) ) {
    70             $this->version = WC_REVIEW_DISCOUNTS_VERSION;
     69        if ( defined( 'XSWCRD_REVIEW_DISCOUNTS_VERSION' ) ) {
     70            $this->version = XSWCRD_REVIEW_DISCOUNTS_VERSION;
    7171        } else {
    7272            $this->version = '1.0.0';
  • review-for-discount/trunk/readme.txt

    r3418682 r3434387  
    77Tested up to: 6.9
    88WC requires at least: 5.0
    9 WC tested up to: 10.2
    10 Stable tag: 1.0.7
     9WC tested up to: 10.4
     10Stable tag: 1.0.8
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    276276
    277277== Changelog ==
     278**1.0.8**
     279Security: Fixed missing authorization vulnerability in AJAX handlers (CVE-2025-14070).
     280Security: Added capability checks to send_test_email and xs_send_mail functions.
     281Security: Restricted custom post type access to administrators only (prevent nonce extraction).
     282Security: Changed custom post type from public to private with manage_options capability.
     283Security: Improved nonce verification and access control for admin-only functions.
     284
    278285**1.0.7**
    279 Fix: Cpoupon amount issue.
     286Fix: Coupon amount issue.
     287
    280288**1.0.6**
    281289Fix: All issue show plugin check.
  • review-for-discount/trunk/review-for-review.php

    r3418682 r3434387  
    1515 * Plugin Name:       Reviewify — Review Discounts & Photo/Video Reviews for WooCommerce
    1616 * Description:       Give customers discount coupons for reviews via automated emails and enable photo and video reviews for WooCommerce.
    17  * Version:           1.0.7
     17 * Version:           1.0.8
    1818 * Author:            XfinitySoft
    1919 * Author URI:        https://xfinitysoft.com/
     
    2424 * Tested up to: 6.9
    2525 * WC requires at least: 5.0.
    26  * WC tested up to: 10.2
     26 * WC tested up to: 10.4
    2727 * License: GPLv2 or later
    2828 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5353);
    5454
    55 if ( ! defined( 'WC_REVIEW_DISCOUNTS_VERSION' ) ) {
    56     define( 'WC_REVIEW_DISCOUNTS_VERSION', '1.0.6' );
    57 }
    5855if ( ! defined( 'XSWCRD_REVIEW_DISCOUNTS_VERSION' ) ) {
    59     define( 'XSWCRD_REVIEW_DISCOUNTS_VERSION', '1.0.6' );
     56    define( 'XSWCRD_REVIEW_DISCOUNTS_VERSION', '1.0.8' );
    6057}
    6158if ( ! defined( 'XSWCRD_ROOT_URL' ) ) {
Note: See TracChangeset for help on using the changeset viewer.