Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/ultimate-dashboard/class-setup.php
+++ b/ultimate-dashboard/class-setup.php
@@ -400,6 +400,14 @@
wp_enqueue_script( 'udb-notice-dismissal', ULTIMATE_DASHBOARD_PLUGIN_URL . '/assets/js/notice-dismissal.js', array( 'jquery' ), ULTIMATE_DASHBOARD_PLUGIN_VERSION, true );
+ wp_localize_script(
+ 'udb-notice-dismissal',
+ 'udbNoticeDismissal',
+ array(
+ 'nonce' => wp_create_nonce( 'udb_dismiss_notice' ),
+ )
+ );
+
}
/**
@@ -452,12 +460,18 @@
*/
public function dismiss_review_notice() {
+ $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : '';
+
+ if ( ! wp_verify_nonce( $nonce, 'udb_dismiss_notice' ) ) {
+ wp_send_json_error( __( 'Invalid token', 'ultimate-dashboard' ) );
+ }
+
if ( empty( $_POST['dismiss'] ) ) {
- wp_send_json_error( 'Invalid Request' );
+ wp_send_json_error( __( 'Invalid request', 'ultimate-dashboard' ) );
}
update_option( 'review_notice_dismissed', 1 );
- wp_send_json_success( 'Review notice has been dismissed.' );
+ wp_send_json_success( __( 'Review notice has been dismissed.', 'ultimate-dashboard' ) );
}
@@ -545,12 +559,18 @@
*/
public function dismiss_bfcm_notice() {
+ $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : '';
+
+ if ( ! wp_verify_nonce( $nonce, 'udb_dismiss_notice' ) ) {
+ wp_send_json_error( __( 'Invalid token', 'ultimate-dashboard' ) );
+ }
+
if ( empty( $_POST['dismiss'] ) ) {
- wp_send_json_error( 'Invalid Request' );
+ wp_send_json_error( __( 'Invalid request', 'ultimate-dashboard' ) );
}
update_option( 'udb_bfcm_notice_dismissed_2025', 1 );
- wp_send_json_success( 'Review notice has been dismissed.' );
+ wp_send_json_success( __( 'BFCM notice has been dismissed.', 'ultimate-dashboard' ) );
}
--- a/ultimate-dashboard/modules/admin-bar/templates/metaboxes/remove-admin-bar-metabox.php
+++ b/ultimate-dashboard/modules/admin-bar/templates/metaboxes/remove-admin-bar-metabox.php
@@ -26,7 +26,7 @@
<h3><?php esc_html_e( 'Remove Admin Bar for:', 'ultimate-dashboard' ); ?></h3>
<div class="field">
<label for="remove_by_roles" class="label select2-label">
- <select name="remove_by_roles[]" id="remove_by_roles" class="ultiselect remove-admin-bar use-select2 is-fullwidth" multiple>
+ <select name="remove_by_roles[]" id="remove_by_roles" class="multiselect remove-admin-bar use-select2 is-fullwidth" multiple>
<option value="all"<?php echo ( in_array( 'all', $saved_roles, true ) ? ' selected' : '' ); ?>>
<?php esc_html_e( 'All', 'ultimate-dashboard' ); ?>
</option>
--- a/ultimate-dashboard/modules/feature/class-feature-module.php
+++ b/ultimate-dashboard/modules/feature/class-feature-module.php
@@ -117,8 +117,10 @@
*/
public function handle_module_actions() {
- if ( empty( $_POST ) || ( ! empty( $_POST['nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'udb_module_nonce_action' ) ) ) {
- wp_send_json_error( __( 'Invalid nonce', 'ultimate-dashboard' ) );
+ $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : '';
+
+ if ( ! wp_verify_nonce( $nonce, 'udb_module_nonce_action' ) ) {
+ wp_send_json_error( __( 'Invalid token', 'ultimate-dashboard' ) );
}
$capability = apply_filters( 'udb_modules_capability', 'manage_options' );
--- a/ultimate-dashboard/modules/onboarding-wizard/templates/onboarding-wizard-template.php
+++ b/ultimate-dashboard/modules/onboarding-wizard/templates/onboarding-wizard-template.php
@@ -300,7 +300,7 @@
<div class="role-dropdown">
<h3><label for="remove_by_roles" class="dropdown-label"><?php esc_html_e( 'Hide Admin Bar for:', 'ultimate-dashboard' ); ?></label></h3>
- <select name="remove_by_roles[]" id="remove_by_roles" class="full-width-dropdown use-select2" multiple>
+ <select name="remove_by_roles[]" id="remove_by_roles" class="full-width-dropdown use-select2" multiple data-placeholder="<?php esc_attr_e( 'Select Role', 'ultimate-dashboard' ); ?>">
<option value="all" <?php echo esc_attr( in_array( 'all', $selected_roles, true ) ? 'selected' : '' ); ?>>
<?php esc_html_e( 'All', 'ultimate-dashboard' ); ?>
</option>
@@ -425,13 +425,11 @@
</h2>
<p data-udb-show-on="subscribe">
- <?php esc_html_e( 'We'll send you an email with a <strong> discount code for Ultimate Dashboard PRO </strong> shortly.', 'ultimate-dashboard' ); ?>
+ <?php echo wp_kses_post( __( 'We'll send you an email with a <strong> discount code for Ultimate Dashboard PRO </strong> shortly.', 'ultimate-dashboard' ) ); ?>
</p>
<p>
- <?php
- esc_html_e( 'What's next? Explore all features from the <strong>"Ultimate Dash..."</strong> admin menu.', 'ultimate-dashboard' );
- ?>
+ <?php echo wp_kses_post( __( 'What's next? Explore all features from the <strong>"Ultimate Dash..."</strong> admin menu.', 'ultimate-dashboard' ) ); ?>
</p>
<p data-udb-show-on="skip-discount">
--- a/ultimate-dashboard/modules/plugin-onboarding/templates/plugin-onboarding-template.php
+++ b/ultimate-dashboard/modules/plugin-onboarding/templates/plugin-onboarding-template.php
@@ -56,7 +56,7 @@
<?php esc_html_e( 'Welcome to Ultimate Dashboard', 'ultimate-dashboard' ); ?>
</span>
<p class="subtitle">
- <?php esc_html_e( 'Complete the 1-Click Setup & get an <strong style="font-weight: 700; color: tomato;">exclusive Discount</strong> on <strong>Ultimate Dashboard PRO!</strong>', 'ultimate-dashboard' ); ?>
+ <?php echo wp_kses_post( __( 'Complete the 1-Click Setup & get an <strong style="font-weight: 700; color: tomato;">exclusive Discount</strong> on <strong>Ultimate Dashboard PRO!</strong>', 'ultimate-dashboard' ) ); ?>
</p>
</div>
@@ -190,11 +190,11 @@
</p>
<p>
- <?php esc_html_e( 'What's next? Explore all features from the <strong>"Ultimate Dash..."</strong> admin menu.', 'ultimate-dashboard' ); ?>
+ <?php echo wp_kses_post( __( 'What's next? Explore all features from the <strong>"Ultimate Dash..."</strong> admin menu.', 'ultimate-dashboard' ) ); ?>
</p>
<p data-udb-show-on="skip-discount">
- <?php esc_html_e( 'This is your last chance to get an exclusive discount on Ultimate Dashboard PRO at the link below! 👇👇👇', 'ultimate-dashboard' ); ?>
+ <strong><?php esc_html_e( 'This is your last chance to get an exclusive discount on Ultimate Dashboard PRO at the link below! 👇👇👇', 'ultimate-dashboard' ); ?></strong>
</p>
</header>
--- a/ultimate-dashboard/modules/widget/class-widget-output.php
+++ b/ultimate-dashboard/modules/widget/class-widget-output.php
@@ -237,7 +237,20 @@
$output = apply_filters( 'udb_widget_output', $output, $output_args );
$output_callback = function () use ( $output ) {
- echo wp_kses_post( $output );
+ $allowed_tags = wp_kses_allowed_html( 'post' );
+ $allowed_tags['form'] = array(
+ 'class' => true,
+ 'method' => true,
+ 'action' => true,
+ );
+ $allowed_tags['input'] = array(
+ 'type' => true,
+ 'name' => true,
+ 'value' => true,
+ 'class' => true,
+ 'required' => true,
+ );
+ echo wp_kses( $output, $allowed_tags );
};
// Add metabox.
--- a/ultimate-dashboard/ultimate-dashboard.php
+++ b/ultimate-dashboard/ultimate-dashboard.php
@@ -3,7 +3,7 @@
* Plugin Name: Ultimate Dashboard
* Plugin URI: https://ultimatedashboard.io/
* Description: Create a custom Dashboard and give the WordPress admin area a more meaningful use.
- * Version: 3.8.14
+ * Version: 3.8.15
* Author: David Vongries
* Author URI: https://davidvongries.com/
* License: GPL v2 or later
@@ -18,7 +18,7 @@
// Plugin constants.
define( 'ULTIMATE_DASHBOARD_PLUGIN_DIR', rtrim( plugin_dir_path( __FILE__ ), '/' ) );
define( 'ULTIMATE_DASHBOARD_PLUGIN_URL', rtrim( plugin_dir_url( __FILE__ ), '/' ) );
-define( 'ULTIMATE_DASHBOARD_PLUGIN_VERSION', '3.8.14' );
+define( 'ULTIMATE_DASHBOARD_PLUGIN_VERSION', '3.8.15' );
define( 'ULTIMATE_DASHBOARD_PLUGIN_FILE', plugin_basename( __FILE__ ) );
// Admin menu specific support.