Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/bdthemes-element-pack-lite/admin/admin-biggopti.php
+++ b/bdthemes-element-pack-lite/admin/admin-biggopti.php
@@ -60,6 +60,8 @@
$response_body = wp_remote_retrieve_body($response);
+ /// error_log($response_body);
+
$biggopties = json_decode($response_body);
if( isset($biggopties) && isset($biggopties->{'element-pack'}) ) {
@@ -314,23 +316,41 @@
wp_send_json_error([ 'message' => 'forbidden' ]);
}
+ // Don't show biggopties on plugin/theme install and upload pages
+ $current_url = isset($_POST['current_url']) ? sanitize_text_field($_POST['current_url']) : '';
+
+ if (!empty($current_url)) {
+ $excluded_patterns = [
+ 'plugin-install.php',
+ 'theme-install.php',
+ 'action=upload-plugin',
+ 'action=upload-theme'
+ ];
+
+ foreach ($excluded_patterns as $pattern) {
+ if (strpos($current_url, $pattern) !== false) {
+ wp_send_json_success([ 'html' => '' ]);
+ }
+ }
+ }
+
$biggopties = $this->get_api_biggopties_data();
$grouped_biggopties = [];
if (is_array($biggopties)) {
foreach ($biggopties as $index => $biggopti) {
if ($this->should_show_biggopti($biggopti)) {
- $biggopti_class = isset($biggopti->biggopti_class) ? $biggopti->biggopti_class : 'default-' . $index;
- if (!isset($grouped_biggopties[$biggopti_class])) {
- $grouped_biggopties[$biggopti_class] = $biggopti;
+ $display_id = isset($biggopti->display_id) ? $biggopti->display_id : 'default-' . $index;
+ if (!isset($grouped_biggopties[$display_id])) {
+ $grouped_biggopties[$display_id] = $biggopti;
}
}
}
}
// Build biggopties using the same pipeline as synchronous rendering
- foreach ($grouped_biggopties as $biggopti_class => $biggopti) {
- $biggopti_id = isset($biggopti->id) ? $biggopti_class : $biggopti->id;
+ foreach ($grouped_biggopties as $display_id => $biggopti) {
+ $biggopti_id = isset($biggopti->id) ? $display_id : $biggopti->id;
self::add_biggopti([
'id' => 'api-biggopti-' . $biggopti_id,
@@ -375,7 +395,16 @@
if ('user' === $meta) {
update_user_meta(get_current_user_id(), $id, true);
} else {
+ // Store in transient for backward compatibility
set_transient($id, true, $time);
+
+ // Also store in options table for persistence
+ $dismissals_option = get_option('bdt_biggopti_dismissals', []);
+ $dismissals_option[$id] = [
+ 'dismissed_at' => time(),
+ 'expires_at' => time() + intval($time),
+ ];
+ update_option('bdt_biggopti_dismissals', $dismissals_option, false);
}
wp_send_json_success();
@@ -445,7 +474,24 @@
if ('user' === $biggopti['dismissible-meta']) {
$expired = get_user_meta(get_current_user_id(), $biggopti_id, true);
} elseif ('transient' === $biggopti['dismissible-meta']) {
+ // Check transient first
$expired = get_transient($biggopti_id);
+
+ // If transient not found, check options table for persistent dismissal
+ if (false === $expired || empty($expired)) {
+ $dismissals_option = get_option('bdt_biggopti_dismissals', []);
+ if (isset($dismissals_option[$biggopti_id])) {
+ $dismissal = $dismissals_option[$biggopti_id];
+ // Check if dismissal is still valid (not expired)
+ if (isset($dismissal['expires_at']) && time() < $dismissal['expires_at']) {
+ $expired = true;
+ } else {
+ // Clean up expired dismissal from options
+ unset($dismissals_option[$biggopti_id]);
+ update_option('bdt_biggopti_dismissals', $dismissals_option, false);
+ }
+ }
+ }
}
// Biggopties visible after transient expire.
--- a/bdthemes-element-pack-lite/bdthemes-element-pack-lite.php
+++ b/bdthemes-element-pack-lite/bdthemes-element-pack-lite.php
@@ -4,14 +4,14 @@
* Plugin Name: Element Pack Lite - Addons for Elementor
* Plugin URI: http://elementpack.pro/
* Description: The all-new <a href="https://elementpack.pro/">Element Pack</a> brings incredibly advanced, and super-flexible widgets, and A to Z essential addons to the Elementor page builder for WordPress. Explore expertly-coded widgets with first-class support by experts.
- * Version: 8.3.15
+ * Version: 8.3.16
* Author: BdThemes
* Author URI: https://bdthemes.com/
* Text Domain: bdthemes-element-pack
* Domain Path: /languages
* License: GPL3
* Elementor requires at least: 3.28
- * Elementor tested up to: 3.34.0
+ * Elementor tested up to: 3.34.1
*/
@@ -82,7 +82,7 @@
if ( ! element_pack_pro_installed() ) {
// Some pre defined value for easy use
- define( 'BDTEP_VER', '8.3.15' );
+ define( 'BDTEP_VER', '8.3.16' );
define( 'BDTEP_TPL_DB_VER', '1.0.0' );
define( 'BDTEP__FILE__', __FILE__ );
if ( ! defined( 'BDTEP_TITLE' ) ) {
--- a/bdthemes-element-pack-lite/includes/setup-wizard/init.php
+++ b/bdthemes-element-pack-lite/includes/setup-wizard/init.php
@@ -422,12 +422,13 @@
// Capability check - only administrators can import templates
if ( ! current_user_can( 'manage_options' ) ) {
- wp_send_json_error( [ 'message' => esc_html__( 'You do not have permission to perform this action.', 'bdthemes-element-pack' ) ] );
+ wp_send_json_error( [ 'message' => esc_html__( 'Unauthorized', 'bdthemes-element-pack' ) ] );
+ wp_die();
}
$json_url = isset( $_POST['import_url'] ) ? esc_url_raw( wp_unslash( $_POST['import_url'] ) ) : '';
- $response = wp_remote_get($json_url, array(
+ $response = wp_safe_remote_get($json_url, array(
'timeout' => 60,
'sslverify' => false
));
@@ -517,7 +518,8 @@
// Capability check - only administrators can import templates
if ( ! current_user_can( 'manage_options' ) ) {
- wp_send_json_error( [ 'message' => esc_html__( 'You do not have permission to perform this action.', 'bdthemes-element-pack' ) ] );
+ wp_send_json_error( [ 'message' => esc_html__( 'Unauthorized', 'bdthemes-element-pack' ) ] );
+ wp_die();
}
$file_url = isset($_POST['import_url']) ? esc_url_raw(wp_unslash($_POST['import_url'])) : '';
@@ -612,7 +614,8 @@
// Capability check - only administrators can import templates
if ( ! current_user_can( 'manage_options' ) ) {
- wp_send_json_error( [ 'message' => esc_html__( 'You do not have permission to perform this action.', 'bdthemes-element-pack' ) ] );
+ wp_send_json_error( [ 'message' => esc_html__( 'Unauthorized', 'bdthemes-element-pack' ) ] );
+ wp_die();
}
$runner = isset($_POST['runner']) ? sanitize_text_field(wp_unslash($_POST['runner'])) : '';
--- a/bdthemes-element-pack-lite/modules/contact-form/module.php
+++ b/bdthemes-element-pack-lite/modules/contact-form/module.php
@@ -105,6 +105,9 @@
foreach ($_POST as $field => $value) {
if (is_email($value)) {
$value = sanitize_email($value);
+ } elseif (in_array($field, ['name', 'subject', 'contact'])) {
+ // Use sanitize_text_field for single-line fields to prevent header injection
+ $value = sanitize_text_field($value);
} else {
$value = sanitize_textarea_field($value);
}
@@ -202,7 +205,9 @@
// get the message from the form and add the IP address of the user below it
$email_message = $this->message_html($form_data['message'], $form_data['name'], $form_data['email'], $contact_number);
// set the e-mail headers with the user's name, e-mail address and character encoding
- $headers = "Reply-To: " . $form_data['name'] . " <" . $form_data['email'] . ">n";
+ // Explicitly remove newlines to prevent header injection
+ $safe_name = str_replace(["r", "n"], '', $form_data['name']);
+ $headers = "Reply-To: " . $safe_name . " <" . $form_data['email'] . ">n";
$headers .= "Content-Type: text/html; charset=UTF-8n";
$headers .= "Content-Transfer-Encoding: 8bitn";
// send the e-mail with the shortcode attribute named 'email' and the POSTed data
--- a/bdthemes-element-pack-lite/modules/cursor-effects/module.php
+++ b/bdthemes-element-pack-lite/modules/cursor-effects/module.php
@@ -93,9 +93,9 @@
'dynamic' => ['active' => true],
'frontend_available' => true,
'render_type' => 'template',
- // 'default' => [
- // 'url' => Utils::get_placeholder_image_src(),
- // ],
+ 'default' => [
+ 'url' => BDTEP_ASSETS_URL . 'images/logo.svg',
+ ],
'condition' => [
'element_pack_cursor_effects_source' => 'image'
]