Plugin Directory

Changeset 3343982


Ignore:
Timestamp:
08/13/2025 07:32:59 AM (8 months ago)
Author:
expresstech
Message:

10.2.6 to trunk

Location:
quiz-master-next/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • quiz-master-next/trunk/css/admin-dashboard-rtl.css

    r3248667 r3343982  
    9898.changelog-ul li .feature {
    9999    background: #25bdfe;
     100}
     101
     102.changelog-ul li .security {
     103    color: #0f0fea;
     104    background: #c0c0ff;
     105}
     106
     107.changelog-ul li span.security:before {
     108    background: #0f0fea;
    100109}
    101110
  • quiz-master-next/trunk/css/admin-dashboard.css

    r3277972 r3343982  
    134134    background: #D1FAE5;
    135135    color: #065F46;
     136}
     137
     138.changelog-ul li .security {
     139    color: #0f0fea;
     140    background: #c0c0ff;
     141}
     142
     143.changelog-ul li span.security:before {
     144    background: #0f0fea;
    136145}
    137146
  • quiz-master-next/trunk/mlw_quizmaster2.php

    r3341668 r3343982  
    33 * Plugin Name: Quiz And Survey Master
    44 * Description: Easily and quickly add quizzes and surveys to your website.
    5  * Version: 10.2.5
     5 * Version: 10.2.6
    66 * Author: ExpressTech
    77 * Author URI: https://quizandsurveymaster.com/
     
    4444     * @since 4.0.0
    4545     */
    46     public $version = '10.2.5';
     46    public $version = '10.2.6';
    4747
    4848    /**
  • quiz-master-next/trunk/php/template-variables.php

    r3341668 r3343982  
    11501150                $answers_random = array();
    11511151                $quiz_answer_random_ids = sanitize_text_field( wp_unslash( $_POST['quiz_answer_random_ids'] ) );
    1152                 $quiz_answer_random_ids = qmn_sanitize_random_ids_data( $quiz_answer_random_ids );
     1152                $quiz_answer_random_ids = qsm_safe_unserialize( $quiz_answer_random_ids );
    11531153                if ( ! empty( $quiz_answer_random_ids[ $answer['id'] ] ) && is_array( $quiz_answer_random_ids[ $answer['id'] ] ) ) {
    11541154                    foreach ( $quiz_answer_random_ids[ $answer['id'] ] as $key ) {
     
    16561656
    16571657/**
    1658  * Sanitize Input Array Data
    1659  *
    1660  * @params $qmn_sanitize_random_ids Questions Data
    1661  * @return $qmn_sanitize_random_ids Returns sanitized data
    1662  */
    1663 function qmn_sanitize_random_ids_data( $qmn_sanitize_random_ids ) {
    1664     if ( is_string( $qmn_sanitize_random_ids ) ) {
    1665         if ( preg_match( '/^(O|C):\d+:/', $qmn_sanitize_random_ids ) ) {
    1666             return '';
    1667         }
    1668 
    1669         if ( is_serialized( $qmn_sanitize_random_ids ) ) {
    1670             $unserialized = maybe_unserialize( $qmn_sanitize_random_ids );
    1671             if ( ! is_object( $unserialized ) && ! is_resource( $unserialized ) ) {
    1672                 return $unserialized;
    1673             }
    1674         }
    1675     }
    1676 
    1677     return $qmn_sanitize_random_ids;
     1658 * Safely unserialize a value while blocking objects/resources and nested serialized payloads.
     1659 *
     1660 * @param mixed $value Serialized string or any other value.
     1661 * @return mixed|null  Unserialized value on success, original value if not serialized, or null if rejected.
     1662 */
     1663function qsm_safe_unserialize( $value ) {
     1664    $result = $value;
     1665
     1666    // If it's not a serialized string, keep original value
     1667    if ( is_string( $value ) && is_serialized( $value ) ) {
     1668        // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize, WordPress.PHP.NoSilencedErrors.Discouraged
     1669        $unserialized_value = unserialize( $value, [ 'allowed_classes' => false ] );
     1670
     1671        $is_invalid_blob = ( false === $unserialized_value && 'b:0;' !== $value );
     1672        $is_disallowed_type = is_object( $unserialized_value ) || is_resource( $unserialized_value );
     1673
     1674        if ( $is_invalid_blob || $is_disallowed_type ) {
     1675            $result = null;
     1676        } else {
     1677            $contains_nested_serialization = false;
     1678
     1679            $scan_for_nested = static function ( $item ) use ( &$contains_nested_serialization ) {
     1680                if ( is_string( $item ) && ( is_serialized( $item ) || preg_match( '/(^|[;:{])(?:[OC]):\d+:"/i', $item ) ) ) {
     1681                    $contains_nested_serialization = true;
     1682                }
     1683            };
     1684
     1685            if ( is_array( $unserialized_value ) ) {
     1686                array_walk_recursive( $unserialized_value, $scan_for_nested );
     1687            } else {
     1688                $scan_for_nested( $unserialized_value );
     1689            }
     1690
     1691            $result = $contains_nested_serialization ? null : $unserialized_value;
     1692        }
     1693    }
     1694
     1695    return $result;
    16781696}
    16791697
  • quiz-master-next/trunk/readme.txt

    r3341668 r3343982  
    55Tested up to: 6.8
    66Requires PHP: 5.4
    7 Stable tag: 10.2.5
     7Stable tag: 10.2.6
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    222222
    223223== Changelog ==
     224= 10.2.6 ( August 13, 2025 ) =
     225* Security: Completed fix for quiz_answer_random_ids vulnerability using secure unserialize() with allowed_classes => false
     226
    224227= 10.2.5 ( August 8, 2025 ) =
    225228* Feature: Added multi-language support for quiz redirect URLs
Note: See TracChangeset for help on using the changeset viewer.