Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/creatorlms/creatorlms.php
+++ b/creatorlms/creatorlms.php
@@ -3,7 +3,7 @@
* Plugin Name: Creator LMS
* Plugin URI: https://getwpfunnels.com/
* Description: Build, sell, and manage online courses easily with the best WordPress LMS plugin made for creators, coaches, and educators.
- * Version: 1.1.12
+ * Version: 1.1.13
* Author: WPFunnels Team
* Author URI: https://getwpfunnels.com
* Text Domain: creatorlms
--- a/creatorlms/includes/CreatorLMS.php
+++ b/creatorlms/includes/CreatorLMS.php
@@ -222,7 +222,7 @@
*
* @var string
*/
- const VERSION = '1.1.12';
+ const VERSION = '1.1.13';
/**
* Plugin slug.
--- a/creatorlms/includes/Rest/V1/SettingsController.php
+++ b/creatorlms/includes/Rest/V1/SettingsController.php
@@ -48,7 +48,7 @@
array(
'methods' => WP_REST_Server::EDITABLE,
'callback' => array( $this, 'update_items' ),
- 'permission_callback' => array( $this, 'get_items_permissions_check' ),
+ 'permission_callback' => array( $this, 'update_items_permissions_check' ),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
@@ -210,6 +210,10 @@
if ( 'payment-gateway' === $group_id && is_array( $value ) && isset( $value['value'] ) ) {
$value = $value['value'];
}
+
+ if ( ! $this->is_valid_option_key( $key ) ) {
+ continue;
+ }
update_option( $key, $value );
flush_rewrite_rules(true);
@@ -224,6 +228,76 @@
}
/**
+ * Validate if the option key is valid.
+ *
+ * @param string $key The option key.
+ * @return bool True if valid, false otherwise.
+ *
+ * @since 1.0.0
+ */
+ private function is_valid_option_key( $key ) {
+ $keys = array(
+ 'creator_lms_course_page_id',
+ 'creator_lms_profile_page_id',
+ 'creator_lms_checkout_page_id',
+ 'creator_lms_thank_you_page_id',
+ 'creator_lms_privacy_policy_page_id',
+ 'creator_lms_terms_page_id',
+ 'creator_lms_registration_page_id',
+ 'creator_lms_courses_per_page',
+ 'creator_lms_archive_page_layout',
+ 'creator_lms_archive_page_layout_style',
+ 'creator_lms_archive_page_filter_is_enabled',
+ 'creator_lms_archive_page_filters',
+ 'creator_lms_archive_page_sorting_is_enabled',
+ 'creator_lms_archive_page_search_is_enabled',
+ 'creator_lms_archive_page_category_is_enabled',
+ 'creator_lms_archive_page_row',
+ 'creator_lms_single_course_page_features',
+ 'creator_lms_single_course_page_layout',
+ 'creator_lms_columns_per_row',
+ 'creator_lms_container_width',
+ 'creator_lms_debug_mode',
+ 'creator_lms_primary_color_scheme',
+ 'creator_lms_primary_hover_color_scheme',
+ 'creator_lms_heading_color_scheme',
+ 'creator_lms_body_text_color_scheme',
+ 'creator_lms_body_progress_color_scheme',
+ 'creator_lms_checkout_page_layout_type',
+ 'creator_lms_leaderboard_settings',
+ 'creator_lms_privacy_policy_message',
+ 'creator_lms_guest_checkout',
+ 'creator_lms_allow_purchase_without_login',
+ 'creator_lms_permalink',
+ 'creatorlms_offline_settings',
+ 'creatorlms_stripe_settings',
+ 'creatorlms_paypal_settings',
+ 'creatorlms_mollie_settings',
+ 'creatorlms_razorpay_settings',
+ 'creatorlms_authorize_net_settings',
+ 'creator_lms_currency',
+ 'creator_lms_currency_pos',
+ 'creator_lms_price_thousand_sep',
+ 'creator_lms_price_decimal_sep',
+ 'creator_lms_price_num_decimals',
+ 'creator_lms_tax_enabled',
+ 'creator_lms_tax_label',
+ 'creator_lms_prices_include_tax',
+ 'creator_lms_eu_vat_enabled',
+ 'creator_lms_disable_vat_validation',
+ 'creator_lms_vat_number_label',
+ 'creator_lms_fallback_tax_rate',
+ 'creator_lms_existing_tax_rates',
+ 'creator_lms_new_tax_rates',
+ 'creator_lms_tax_rates',
+ 'creator_lms_countries',
+ 'creator_lms_states',
+ );
+ return in_array( $key, $keys, true );
+ }
+
+
+ /**
* Get a single item (setting) for a specific group.
*
* @param WP_REST_Request $request The request object.
@@ -415,7 +489,7 @@
* @since 1.0.0
*/
public function get_items_permissions_check( $request ) {
- return current_user_can( 'edit_posts' );
+ return current_user_can( 'manage_options' );
}
/**
@@ -427,6 +501,6 @@
* @since 1.0.0
*/
public function update_items_permissions_check( $request ) {
- return current_user_can( 'edit_posts' );
+ return current_user_can( 'manage_options' );
}
}
--- a/creatorlms/vendor/composer/installed.php
+++ b/creatorlms/vendor/composer/installed.php
@@ -5,7 +5,7 @@
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => 'cf5619a591f5a719a7572ee5b34b39cc593c16ca',
+ 'reference' => '0eb1ec396b40de0d6ec425c0493e2225c68dc51f',
'name' => 'rextheme/plugin_name',
'dev' => false,
),
@@ -36,7 +36,7 @@
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => 'cf5619a591f5a719a7572ee5b34b39cc593c16ca',
+ 'reference' => '0eb1ec396b40de0d6ec425c0493e2225c68dc51f',
'dev_requirement' => false,
),
),