Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/everest-forms/everest-forms.php
+++ b/everest-forms/everest-forms.php
@@ -3,7 +3,7 @@
* Plugin Name: Everest Forms
* Plugin URI: https://everestforms.net/
* Description: Easily create contact form, payment form, conversational form, calculator, multi-step form, registration form, quiz form, survey form etc.
- * Version: 3.5.2
+ * Version: 3.5.3
* Author: Everest Forms
* Author URI: https://everestforms.net/
* Text Domain: everest-forms
--- a/everest-forms/includes/Integrations/AI/class-evf-ai-registration.php
+++ b/everest-forms/includes/Integrations/AI/class-evf-ai-registration.php
@@ -56,33 +56,30 @@
* @return bool
*/
public static function is_local_site(): bool {
- if ( function_exists( 'wp_get_environment_type' ) && 'local' === wp_get_environment_type() ) {
- return true;
- }
-
$host = wp_parse_url( site_url(), PHP_URL_HOST );
- if ( empty( $host ) ) {
- return false;
- }
- $host = strtolower( $host );
+ $host = $host ? strtolower( $host ) : '';
- if ( in_array( $host, array( 'localhost', '127.0.0.1', '::1' ), true ) ) {
- return true;
- }
+ $is_local = ( function_exists( 'wp_get_environment_type' ) && 'local' === wp_get_environment_type() )
+ || in_array( $host, array( 'localhost', '127.0.0.1', '::1' ), true );
- foreach ( array( '.local', '.test', '.localhost' ) as $suffix ) {
- if ( substr( $host, -strlen( $suffix ) ) === $suffix ) {
- return true;
+ if ( ! $is_local ) {
+ foreach ( array( '.local', '.test', '.localhost' ) as $suffix ) {
+ if ( '' !== $host && substr( $host, -strlen( $suffix ) ) === $suffix ) {
+ $is_local = true;
+ break;
+ }
}
}
/**
- * Filter whether the current site is treated as local for AI features.
+ * Filter whether the current site is treated as local for AI features — the final say
+ * over the heuristics above, e.g. to test the live gateway from a .local domain (set
+ * this to __return_false), or to block a host the heuristics miss.
*
- * @param bool $is_local Whether the site is considered local.
+ * @param bool $is_local Whether the built-in heuristics consider this site local.
* @param string $host The detected site host.
*/
- return (bool) apply_filters( 'everest_forms_ai_is_local_site', false, $host );
+ return (bool) apply_filters( 'everest_forms_ai_is_local_site', $is_local, $host );
}
/**
--- a/everest-forms/includes/admin/builder/class-evf-builder-fields.php
+++ b/everest-forms/includes/admin/builder/class-evf-builder-fields.php
@@ -440,14 +440,16 @@
echo '</div>';
echo '<div class="clear evf-clear"></div>';
- if ( defined( 'EVF_REPEATER_FIELDS_VERSION' ) ) {
+ // Repeater controls require the Pro plugin (EFP_VERSION); without it the addon
+ // does not register the repeater field, so the button must not be shown.
+ if ( defined( 'EVF_REPEATER_FIELDS_VERSION' ) && defined( 'EFP_VERSION' ) ) {
echo '<div class="evf-repeater-row-wrapper">'; // Repeater Row Wrapper starts.
}
$next_row_id = $row_ids ? max( $row_ids ) : 1;
echo '<div class="evf-add-row" data-total-rows="' . count( $structure ) . '" data-next-row-id="' . (int) $next_row_id . '"><span class="everest-forms-btn everest-forms-btn-primary dashicons dashicons-plus-alt">' . esc_html__( 'Add Row', 'everest-forms' ) . '</span></div>';
- if ( defined( 'EVF_REPEATER_FIELDS_VERSION' ) ) {
+ if ( defined( 'EVF_REPEATER_FIELDS_VERSION' ) && defined( 'EFP_VERSION' ) ) {
echo '<div class="evf-add-row repeater-row" data-total-rows="' . count( $structure ) . '" data-next-row-id="' . (int) $next_row_id . '"><span class="everest-forms-btn everest-forms-btn-primary dashicons dashicons-plus-alt">' . esc_html__( 'Add Repeater Row', 'everest-forms' ) . '</span></div>';
echo '</div>'; // Repeater Row Wrapper ends.
}
--- a/everest-forms/includes/admin/class-evf-admin-assets.php
+++ b/everest-forms/includes/admin/class-evf-admin-assets.php
@@ -294,6 +294,8 @@
'form_one_time_draggable_fields' => evf_get_one_time_draggable_fields(),
'i18n_privacy_policy_consent_message' => esc_html__( 'I allow this website to collect and store the submitted data.', 'everest-forms' ),
'is_pro' => ( ! defined( 'EFP_PLUGIN_FILE' ) ) ? false : true,
+ 'currency_symbol' => function_exists( 'evf_get_currencies' ) ? ( evf_get_currencies()[ strtoupper( get_option( 'everest_forms_currency', 'USD' ) ) ]['symbol'] ?? '$' ) : '$',
+ 'currency_symbol_pos' => function_exists( 'evf_get_currencies' ) ? ( evf_get_currencies()[ strtoupper( get_option( 'everest_forms_currency', 'USD' ) ) ]['symbol_pos'] ?? 'left' ) : 'left',
'select_form_tags_placeholder' => __( 'Please choose a tags from the list, or type in a new tag if you'd like to add one.', 'everest-forms' ),
'i18n_expiry_trial_min_date' => esc_html__( 'Expiry must be on or after the trial ends (%s).', 'everest-forms' ),
'i18n_expiry_trial_blocked_day' => esc_html__( 'This date is within the trial period and cannot be used as the expiry date.', 'everest-forms' ),
--- a/everest-forms/includes/admin/class-evf-admin-entries-table-list.php
+++ b/everest-forms/includes/admin/class-evf-admin-entries-table-list.php
@@ -240,12 +240,23 @@
// Skip system fields
$skip_fields = array( 'entry_id', 'form_id', 'user_id', 'user_device', 'user_ip_address', 'viewed', 'starred', 'status' );
+ // Upload fields store only the hashed file URL in entry meta, so map each
+ // upload field's meta key to its original file name(s) from the full
+ // entry fields. This keeps the preview readable (e.g. "photo.png") instead
+ // of the full URL / hashed file name. See EVF-2095.
+ $upload_names = $this->get_upload_field_names( $entry );
+
// Find first non-empty field value
foreach ( $entry->meta as $key => $value ) {
if ( in_array( $key, $skip_fields, true ) || strpos( $key, '_' ) === 0 ) {
continue;
}
+ // Prefer the original file name(s) for upload fields.
+ if ( isset( $upload_names[ $key ] ) && '' !== $upload_names[ $key ] ) {
+ return $upload_names[ $key ];
+ }
+
// Process the value
$field_value = $this->process_field_value( $value );
@@ -258,6 +269,54 @@
}
/**
+ * Build a map of upload field meta keys to their original file name(s).
+ *
+ * Entry meta only stores the public file URL (with a hashed file name), so
+ * the original names are read from the full entry fields payload. See EVF-2095.
+ *
+ * @param object $entry Entry object.
+ * @return array Map of meta key => escaped, comma-separated original file names.
+ */
+ private function get_upload_field_names( $entry ) {
+ $names = array();
+
+ $fields = isset( $entry->fields ) ? evf_decode( $entry->fields ) : array();
+
+ if ( empty( $fields ) || ! is_array( $fields ) ) {
+ return $names;
+ }
+
+ foreach ( $fields as $field ) {
+ if ( empty( $field['meta_key'] ) || empty( $field['type'] ) ) {
+ continue;
+ }
+
+ if ( ! in_array( $field['type'], array( 'image-upload', 'file-upload' ), true ) ) {
+ continue;
+ }
+
+ if ( empty( $field['value_raw'] ) || ! is_array( $field['value_raw'] ) ) {
+ continue;
+ }
+
+ $file_names = array();
+ foreach ( $field['value_raw'] as $file ) {
+ if ( ! empty( $file['file_original'] ) ) {
+ $file_names[] = $file['file_original'];
+ } elseif ( ! empty( $file['name'] ) ) {
+ $file_names[] = $file['name'];
+ }
+ }
+
+ if ( ! empty( $file_names ) ) {
+ $names[ $field['meta_key'] ] = esc_html( implode( ', ', $file_names ) );
+ }
+ }
+
+ return $names;
+ }
+
+ /**
* Column for form name (All Forms view only)
*
* @param object $entry Entry object.
--- a/everest-forms/includes/admin/class-evf-admin-entries.php
+++ b/everest-forms/includes/admin/class-evf-admin-entries.php
@@ -234,6 +234,9 @@
$entry_id = absint( $_GET['trash'] ); // phpcs:ignore WordPress.Security.NonceVerification
if ( $entry_id ) {
+ if ( ! current_user_can( 'everest_forms_delete_entry', $entry_id ) ) {
+ wp_die( esc_html__( 'You do not have permission to trash this entry.', 'everest-forms' ), 403 );
+ }
self::update_status( $entry_id, 'trash' );
}
}
@@ -263,6 +266,9 @@
$entry_id = absint( $_GET['untrash'] ); // phpcs:ignore WordPress.Security.NonceVerification
if ( $entry_id ) {
+ if ( ! current_user_can( 'everest_forms_edit_entry', $entry_id ) ) {
+ wp_die( esc_html__( 'You do not have permission to restore this entry.', 'everest-forms' ), 403 );
+ }
self::update_status( $entry_id, 'publish' );
}
}
@@ -293,6 +299,9 @@
$entry_id = absint( $_GET['delete'] ); // phpcs:ignore WordPress.Security.NonceVerification
if ( $entry_id ) {
+ if ( ! current_user_can( 'everest_forms_delete_entry', $entry_id ) ) {
+ wp_die( esc_html__( 'You do not have permission to delete this entry.', 'everest-forms' ), 403 );
+ }
self::remove_entry( $entry_id, $form_id );
}
}
--- a/everest-forms/includes/admin/class-evf-admin-menus.php
+++ b/everest-forms/includes/admin/class-evf-admin-menus.php
@@ -273,8 +273,8 @@
}
add_submenu_page(
'everest-forms',
- esc_html__( 'Payment', 'everest-forms' ),
- esc_html__( 'Payment', 'everest-forms' ),
+ esc_html__( 'Payments', 'everest-forms' ),
+ esc_html__( 'Payments', 'everest-forms' ),
'manage_everest_forms',
'evf-payment-log',
array( $this, 'payments_page' )
--- a/everest-forms/includes/admin/settings/class-evf-settings-security.php
+++ b/everest-forms/includes/admin/settings/class-evf-settings-security.php
@@ -23,6 +23,8 @@
add_action( 'everest_forms_update_options_' . $this->id, array( $this, 'handle_captcha_enable_toggle' ), 5 );
$this->maybe_migrate_legacy_settings();
+
+ add_action( 'everest_forms_update_options_' . $this->id, array( $this, 'handle_recaptcha_language_save' ), 5 );
}
private function maybe_migrate_legacy_settings() {
@@ -173,6 +175,37 @@
}
}
+ /**
+ * Persists the shared language option from whichever accordion's field was posted.
+ */
+ public function handle_recaptcha_language_save() {
+ if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), 'everest-forms-settings' ) ) {
+ return;
+ }
+
+ $language_fields = array(
+ 'everest_forms_recaptcha_v2_language',
+ 'everest_forms_recaptcha_v3_language',
+ 'everest_forms_recaptcha_hcaptcha_language',
+ 'everest_forms_recaptcha_turnstile_language',
+ );
+
+ foreach ( $language_fields as $field ) {
+ if ( ! isset( $_POST[ $field ] ) ) {
+ continue;
+ }
+
+ $value = sanitize_text_field( wp_unslash( $_POST[ $field ] ) );
+ $lang_options = $this->get_language_options();
+
+ if ( array_key_exists( $value, $lang_options ) ) {
+ update_option( 'everest_forms_recaptcha_recaptcha_language', $value );
+ }
+
+ return;
+ }
+ }
+
private function add_toast_redirect( $message, $type = 'error' ) {
$redirect_url = add_query_arg(
array(
@@ -310,7 +343,8 @@
$hcaptcha_enabled = get_option( 'everest_forms_recaptcha_hcaptcha_enable', 'no' );
$turnstile_enabled = get_option( 'everest_forms_recaptcha_turnstile_enable', 'no' );
- $lang_options = $this->get_language_options();
+ $lang_options = $this->get_language_options();
+ $shared_language = get_option( 'everest_forms_recaptcha_recaptcha_language', 'en-GB' );
$accordion_items = array(
array(
@@ -369,14 +403,16 @@
'desc_tip' => true,
),
array(
- 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
- 'type' => 'select',
- 'desc' => esc_html__( 'Choose a preferred language for displaying reCAPTCHA v2.', 'everest-forms' ),
- 'id' => 'everest_forms_recaptcha_recaptcha_language',
- 'options' => $lang_options,
- 'class' => 'evf-enhanced-select',
- 'default' => 'en-GB',
- 'desc_tip' => true,
+ 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
+ 'type' => 'select',
+ 'desc' => esc_html__( 'Choose a preferred language for displaying reCAPTCHA v2.', 'everest-forms' ),
+ 'id' => 'everest_forms_recaptcha_v2_language',
+ 'value' => $shared_language,
+ 'is_option' => false,
+ 'options' => $lang_options,
+ 'class' => 'evf-enhanced-select evf-recaptcha-language-select',
+ 'default' => 'en-GB',
+ 'desc_tip' => true,
),
),
),
@@ -423,14 +459,16 @@
'desc_tip' => true,
),
array(
- 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
- 'type' => 'select',
- 'desc' => esc_html__( 'Choose a preferred language for displaying reCAPTCHA v3.', 'everest-forms' ),
- 'id' => 'everest_forms_recaptcha_recaptcha_language',
- 'options' => $lang_options,
- 'class' => 'evf-enhanced-select',
- 'default' => 'en-GB',
- 'desc_tip' => true,
+ 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
+ 'type' => 'select',
+ 'desc' => esc_html__( 'Choose a preferred language for displaying reCAPTCHA v3.', 'everest-forms' ),
+ 'id' => 'everest_forms_recaptcha_v3_language',
+ 'value' => $shared_language,
+ 'is_option' => false,
+ 'options' => $lang_options,
+ 'class' => 'evf-enhanced-select evf-recaptcha-language-select',
+ 'default' => 'en-GB',
+ 'desc_tip' => true,
),
),
),
@@ -464,14 +502,16 @@
'desc_tip' => true,
),
array(
- 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
- 'type' => 'select',
- 'desc' => esc_html__( 'Choose a preferred language for displaying hCaptcha.', 'everest-forms' ),
- 'id' => 'everest_forms_recaptcha_recaptcha_language',
- 'options' => $lang_options,
- 'class' => 'evf-enhanced-select',
- 'default' => 'en-GB',
- 'desc_tip' => true,
+ 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
+ 'type' => 'select',
+ 'desc' => esc_html__( 'Choose a preferred language for displaying hCaptcha.', 'everest-forms' ),
+ 'id' => 'everest_forms_recaptcha_hcaptcha_language',
+ 'value' => $shared_language,
+ 'is_option' => false,
+ 'options' => $lang_options,
+ 'class' => 'evf-enhanced-select evf-recaptcha-language-select',
+ 'default' => 'en-GB',
+ 'desc_tip' => true,
),
),
),
@@ -519,14 +559,16 @@
'desc_tip' => true,
),
array(
- 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
- 'type' => 'select',
- 'desc' => esc_html__( 'Choose a preferred language for displaying Cloudflare Turnstile.', 'everest-forms' ),
- 'id' => 'everest_forms_recaptcha_recaptcha_language',
- 'options' => $lang_options,
- 'class' => 'evf-enhanced-select',
- 'default' => 'en-GB',
- 'desc_tip' => true,
+ 'title' => esc_html__( 'CAPTCHA Language', 'everest-forms' ),
+ 'type' => 'select',
+ 'desc' => esc_html__( 'Choose a preferred language for displaying Cloudflare Turnstile.', 'everest-forms' ),
+ 'id' => 'everest_forms_recaptcha_turnstile_language',
+ 'value' => $shared_language,
+ 'is_option' => false,
+ 'options' => $lang_options,
+ 'class' => 'evf-enhanced-select evf-recaptcha-language-select',
+ 'default' => 'en-GB',
+ 'desc_tip' => true,
),
),
),
--- a/everest-forms/includes/admin/views/html-admin-page-setting.php
+++ b/everest-forms/includes/admin/views/html-admin-page-setting.php
@@ -109,7 +109,8 @@
</td>
</tr>
<?php
- } elseif ( is_plugin_active( 'everest-forms/everest-forms.php' ) ) {
+ }
+ if ( is_plugin_active( 'everest-forms/everest-forms.php' ) ) {
?>
<tr>
<th colspan="2">
@@ -186,20 +187,22 @@
</tr>
<tr>
- <th><?php esc_html_e( 'Plugins', 'everest-forms' ); ?></th>
+ <th><?php esc_html_e( 'Addons', 'everest-forms' ); ?></th>
<td>
<?php
$evf_stats_obj = new EVF_Stats();
$plugin_lists = $evf_stats_obj->get_plugin_lists();
- if ( ! empty( $plugin_lists ) ) {
- foreach ( $plugin_lists as $plugin_slug => $plugin_data ) {
+ $active_addons = ! empty( $plugin_lists['active_addons'] ) ? $plugin_lists['active_addons'] : array();
+
+ if ( ! empty( $active_addons ) ) {
+ foreach ( $active_addons as $plugin_slug => $plugin_data ) {
if ( isset( $plugin_data['product_name'] ) && isset( $plugin_data['product_version'] ) ) {
echo esc_html( $plugin_data['product_name'] . ' (' . $plugin_data['product_version'] . ')' ) . '<br>';
}
}
} else {
- esc_html_e( 'No plugin lists available.', 'everest-forms' );
+ esc_html_e( 'No Addons lists available.', 'everest-forms' );
}
?>
</td>
--- a/everest-forms/includes/class-everest-forms.php
+++ b/everest-forms/includes/class-everest-forms.php
@@ -23,7 +23,7 @@
*
* @var string
*/
- public $version = '3.5.2';
+ public $version = '3.5.3';
/**
* The single instance of the class.
--- a/everest-forms/includes/class-evf-ajax.php
+++ b/everest-forms/includes/class-evf-ajax.php
@@ -697,6 +697,15 @@
public static function template_activate_addon() {
check_ajax_referer( 'everest_forms_template_licence_check', 'security' );
+ if ( ! current_user_can( 'activate_plugins' ) ) {
+ wp_send_json_error(
+ array(
+ 'errorCode' => 'invalid_permission',
+ 'errorMessage' => esc_html__( 'You do not have permission to activate plugins.', 'everest-forms' ),
+ )
+ );
+ }
+
if ( empty( $_POST['addon'] ) ) {
wp_send_json_error(
array(
@@ -706,7 +715,20 @@
);
}
- $activate = activate_plugin( sanitize_text_field( wp_unslash( $_POST['addon'] ) ) . '/' . sanitize_text_field( wp_unslash( $_POST['addon'] ) ) . '.php' );
+ $addon = sanitize_text_field( wp_unslash( $_POST['addon'] ) );
+
+ // Restrict activation to genuine Everest Forms addons so this endpoint
+ // cannot be used to activate arbitrary installed plugins.
+ if ( ! in_array( $addon, EVF_Modules::get_allowed_addon_slugs(), true ) ) {
+ wp_send_json_error(
+ array(
+ 'errorCode' => 'invalid_addon_slug',
+ 'errorMessage' => esc_html__( 'The requested module is not a valid Everest Forms addon.', 'everest-forms' ),
+ )
+ );
+ }
+
+ $activate = activate_plugin( $addon . '/' . $addon . '.php' );
if ( is_wp_error( $activate ) ) {
wp_send_json_error(
@@ -1404,7 +1426,28 @@
public static function active_addons() {
try {
check_ajax_referer( 'evf_active_nonce', 'security' );
- $plugin = isset( $_POST['plugin_file'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_file'] ) ) : '';
+
+ if ( ! current_user_can( 'activate_plugins' ) ) {
+ wp_send_json_error(
+ array(
+ 'message' => esc_html__( 'You do not have permission to activate plugins.', 'everest-forms' ),
+ )
+ );
+ }
+
+ $plugin = isset( $_POST['plugin_file'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_file'] ) ) : '';
+ $slug = dirname( $plugin );
+
+ // Restrict activation to genuine Everest Forms addons so this endpoint
+ // cannot be used to activate arbitrary installed plugins.
+ if ( '' === $plugin || ! in_array( $slug, EVF_Modules::get_allowed_addon_slugs(), true ) ) {
+ wp_send_json_error(
+ array(
+ 'message' => esc_html__( 'The requested module is not a valid Everest Forms addon.', 'everest-forms' ),
+ )
+ );
+ }
+
$activate = activate_plugin( $plugin );
if ( is_wp_error( $activate ) ) {
$activation_error = $activate->get_error_message();
--- a/everest-forms/includes/fields/class-evf-field-address.php
+++ b/everest-forms/includes/fields/class-evf-field-address.php
@@ -920,14 +920,12 @@
if ( empty( $postal['hidden'] ) && isset( $field['enable_country_flag'] ) ) {
$country['class'][] = esc_attr( 'evf-country-flag-selector' );
}
- if ( ! array_key_exists( 'repeater-fields', $field ) ) {
- printf(
- '<input id="%s" type="hidden" class="input-text evf-conditional-logic-holder" conditional_rules="%s" conditional_id="%s" />',
- esc_attr( $field['id'] ),
- esc_attr( $conditional_rules ),
- esc_attr( $conditional_id )
- );
- }
+ printf(
+ '<input id="%s" type="hidden" class="input-text evf-conditional-logic-holder" conditional_rules="%s" conditional_id="%s" />',
+ esc_attr( $field['id'] ),
+ esc_attr( $conditional_rules ),
+ esc_attr( $conditional_id )
+ );
do_action( 'everest_forms_map_field_display', $field, $field_atts, $form_data );
if ( 'yes' === $current_location ) {