Skip to content

Commit

Permalink
Merge branch 'release/3.16.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Waldstein committed Sep 10, 2024
2 parents e2f14ca + 04eb44d commit 13d6dd2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 3.16.0
* Version: 3.16.1
* Requires at least: 6.4
* Requires PHP: 7.2
* Text Domain: give
Expand Down Expand Up @@ -406,7 +406,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.16.0');
define('GIVE_VERSION', '3.16.1');
}

// Plugin Root File.
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/admin-actions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Give\Framework\Database\DB;
use Give\Helpers\Utils;
use Give\Log\ValueObjects\LogType;

/**
Expand Down Expand Up @@ -680,6 +681,7 @@ function showReactTable () {
/**
* Avoid insecure usage of `unserialize` when the data could be submitted by the user.
*
* @since 3.16.1 Use Utils::giveMaybeSafeUnserialize() method
* @since 3.5.0
*
* @param string $data Data that might be unserialized.
Expand All @@ -688,9 +690,7 @@ function showReactTable () {
*/
function give_maybe_safe_unserialize($data)
{
return is_serialized($data)
? @unserialize(trim($data), ['allowed_classes' => false])
: $data;
return Utils::maybeSafeUnserialize($data);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion includes/process-donation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Handles the donation form process.
*
* @access private
* @since 3.16.1 Use give_maybe_safe_unserialize() on $user_info data
* @since 1.0
*
* @throws ReflectionException Exception Handling.
Expand Down Expand Up @@ -151,12 +152,13 @@ function give_process_donation_form() {
);

// Setup donation information.
$user_info = array_map('\Give\Helpers\Utils::maybeSafeUnserialize', stripslashes_deep( $user_info ));
$donation_data = [
'price' => $price,
'purchase_key' => $purchase_key,
'user_email' => $user['user_email'],
'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
'user_info' => stripslashes_deep( $user_info ),
'user_info' => $user_info,
'post_data' => $post_data,
'gateway' => $valid_data['gateway'],
'card_info' => $valid_data['cc_info'],
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.2
Stable tag: 3.16.0
Stable tag: 3.16.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -262,6 +262,9 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri
10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on.

== Changelog ==
= 3.16.1: September 10th, 2024 =
* Security: Added additional protection to the option-based donation form request (CVE-2024-8353)

= 3.16.0: Aug 28th, 2024 =
* New: Added support for form taxonomy tags and categories in the visual form builder settings
* New: Added a setting to the visual form builder to enable redirecting to an individual donation confirmation page
Expand Down
16 changes: 16 additions & 0 deletions src/Helpers/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,20 @@ public static function isPluginActive($plugin)

return is_plugin_active($plugin);
}

/**
* Avoid insecure usage of `unserialize` when the data could be submitted by the user.
*
* @since 3.16.1
*
* @param string $data Data that might be unserialized.
*
* @return mixed Unserialized data can be any type.
*/
public static function maybeSafeUnserialize($data)
{
return is_serialized($data)
? @unserialize(trim($data), ['allowed_classes' => false])
: $data;
}
}

0 comments on commit 13d6dd2

Please sign in to comment.